草庐IT

MediaScan

全部标签

android - 如何在 Nexus 7 上触发 MediaScan?

因为我想确保MediaStore具有最新信息而无需重新启动我想使用我在SO上找到的流行方式触发MediaScannercontext.sendBroadcast(newIntent(Intent.ACTION_MEDIA_MOUNTED,Uri.parse("file://"+Environment.getExternalStorageDirectory())));这在我的带ICS的三星S2上运行良好,但在带JellyBean的Nexus7上却不行。Logcat在我的Nexus7上显示了这个:WARN/ActivityManager(480):Permissiondenied:chec