I know this is duplicate question but there is not available any solution for this. I have used latest API Level 24 and Test on API 23. I have to save image on SD Card with my App Name folder but folder is not created...

I have write following method but it not working

```
    public  void actionScreenShot(View view) {

        //enable drawing cache true
        imageContainer.setDrawingCacheEnabled(true);
        imageContainer.buildDrawingCache(true);

        //create image from layout
        Bitmap bitmap = Bitmap.createBitmap(imageContainer.getDrawingCache());

        //String folder_path = getApplicationContext().getFilesDir().getPath() + "/MyAppTest/"; //It's work properly
        //String folder_path = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DCIM) + "/MyAppTest/"; //It's work properly 
        String folder_path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + "/MyAppTest"; //It's not work properly
        if (checkFile(folder_path)) {
            saveFile(new File(folder_path), bitmap);
        } else {
            File folder = new File(folder_path);
            if (folder.mkdirs()) {
                saveFile(folder, bitmap);
            } else {
                Log.d("Directory", " >> not created");
            }

        }
    }

    public void saveFile(File folder, Bitmap bitmap) {
        boolean success = false;
        try {
            File file = new File(folder, "temp.png");
            if (file.exists()) file.delete();
            FileOutputStream out = new FileOutputStream(file);
            bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
            out.flush();
            out.close();
            success = checkDatabase(file.getPath());
        }catch (Exception e) {
            e.printStackTrace();
        }

        if (success) {
            Log.d("FILE", "success");
        } else {
            Log.d("FILE", "not success");
        }
    }

    public boolean checkFile(String myPath) {
        boolean isExist = false;
        try {
            File file = new File(myPath);
            isExist = file.exists();
        } catch (Exception e) {

        }
        return isExist;

    }

```

Permission is given also in AndroidManifest.xml

```
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

```

Log Trace as following...

```
10-05 17:08:09.424 2808-2808/packagename D/Directory  >> not created

```

If any solution available then help me...

Thanks....