关于 Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_

About Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED from Error cause
When developing the image scanning function on Android4.4, it is generally used: sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(" file://"+ Environment.getExternalStorageDirectory()+ picPath)));
But because Android 4.4 restricts system applications to use the broadcast notification system to scan the SD card, the above error will be reported.


this.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + Environment.getExternalStorageDirectory())));

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326778013&siteId=291194637