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

后端 未结 3 1889
猫巷女王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())));
    
    0 讨论(0)
  • 2020-12-21 04:55
    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

    0 讨论(0)
  • 2020-12-21 04:57

    One can also invoke from the shell:

    am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard
    
    0 讨论(0)
提交回复
热议问题