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

后端 未结 3 1893
猫巷女王i
猫巷女王i 2020-12-21 04:30

So my app downloads images at the users\' request from an online source. Through a button in the activity, the user can choose to hide or show the images in the gallery. T

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-21 04:47

    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())));
    

提交回复
热议问题