Android will automatically perform a media refresh when an SD card is mounted.
Using adb, we can fake that event by manually sending a MEDIA_MOUNTED
intent.
For example, if you wanted to run a media refresh of the entire SD card:
1 |
|
To refresh different directory, just change "/sdcard" to the absolute path of the directory you want to refresh.
For more fine-grained control, use the MEDIA_SCANNER_SCAN_FILE
intent, which triggers a rescan of a single file.