This question is not related to this question. I have already seen it but it's SPECIFIC Android 4.4.2 issue as the code works fine on other versions of Android.
final File path = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/MY_Downloads");
if (!path.exists()) {
path.mkdir(); // also tried it with path.mkdirs();
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(path)));
}
I am using this code it creates a FILE instead of a folder on Android 4.4.2. Please help I have already read this article
I have given following permissions
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I know how to access SD-Card and the latest changes regarding public directory but I want to create a FOLDER instead of file