Caused by: java.lang.IllegalStateException: Unable to create directory in Android 6.0 devices
问题 I have to store the download the image from the url using DownloadManager and store it into the sdcard with my own directory like "xyz". This is my code File img_directory = null; img_directory = new File(Environment.getExternalStorageDirectory() + "/xyz"); if (!img_directory.exists()) { img_directory.mkdirs(); DownloadManager mgr = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); Uri downloadUri = Uri.parse("my image url"); DownloadManager.Request request = new DownloadManager