Reputation: 3
I had below code to refresh local media store(Environment.DIRECTORY_PICTURES)
Now suddenly this throws permission denied exception.
How do i solve this
Thanks
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
Uri.parse(MainActivity.BASE_PATH + File.separator
+ _orderNo + File.separator
+ Constants.BASICINFO_FILE_NAME)));
Upvotes: 0
Views: 997
Reputation: 1006819
That was never appropriate code in the first place, and it is now explicitly blocked as of Android 4.4.
Instead, use MediaScannerConnection
or ACTION_MEDIA_SCANNER_SCAN_FILE
to request indexing of new files.
Upvotes: 3