title: Create directory in Android Ddevice
body: <p>I'm having problems creating directories with Android Studio in an old  phone (v 4.4.4), I've tried in more modern phones and it works, here's the code:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private static final String LOG_TAG = "DIRECTORY";
      private Button click;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          setup();
      }
  
      private void setup() {
          click = findViewById(R.id.button);
          click.setOnClickListener(v -&gt; getAlbumStorageDir(this, "samuel_es_dios"));
      }
  
      public void getAlbumStorageDir(Context context, String albumName) {
  
          pedirPermisos();
          // Get the directory for the app's private pictures directory.
          File file = new File(Environment.getExternalStoragePublicDirectory(
                  Environment.DIRECTORY_PICTURES)+ "/"+ albumName);
          if (!file.mkdirs()) {
              Log.e(LOG_TAG, "Directory not created");
          }else {
              Log.e(LOG_TAG, "Directory created");
          }
      }
  
      private void pedirPermisos() {
          if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
              ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},50);
          }
      }
  }
  </code></pre>
  
  <p><strong>And here's the Manifest:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="iam47662285.escoladeltreball.org.pruebasfile"&gt;
  
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>When it tries to create the directory it doesn't do it, I don't think that's a problem of permissions, I directly ask for them. Any idea what is happening?</p>