次のコードがあります。
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
Uri.parse("file://" + Environment.getExternalStorageDirectory().getAbsolutePath())));
そして私のマニフェストに、私は追加しました:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.ACTION_MEDIA_MOUNTED"/>
<action android:name="android.intent.action.MEDIA_EJECT" />
<action android:name="android.intent.ACTION_MEDIA_SCANNER_SCAN_FILE"/>
<data android:scheme="file"/>
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
次のエラーが表示されます
07-20 13:16:31.203: WARN/BroadcastQueue(395): Permission Denial: broadcasting Intent { act=android.intent.action.MEDIA_MOUNTED dat=file:///storage/sdcard0 flg=0x10 } from com.example.Music_Exchanger (pid=11797, uid=10080) is not exported from uid 10016 due to receiver com.android.providers.downloads/com.android.providers.downloads.DownloadReceiver
なぜ否定されるのかわからない。そして、どうすれば解決できますか?
ご存知の方、詳しく書いてくださると助かります。私はただの初心者です。
どうもありがとう!