On Android: How can I rescan an entire folder to watch for changes in .nomedia

不羁的心 提交于 2019-11-29 14:34:16

Finally found it at http://groups.google.com/group/android-developers/browse_thread/thread/c1a385226f3df482.

It is a one-liner:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse
("file://"
+ Environment.getExternalStorageDirectory())));
am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard

This command can be used to update the SD Card without rebooting the device

One can also invoke from the shell:

am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!