Scan Media

Force the system to scan the SD card for new/deleted media. This can save a lot of time removing and reinserting the physical card.

If a file is specified, only that file is scanned.
If a directory is specified, all of its contents will be scanned recursively.

Note: repeatedly scanning the same file will not update the thumbnail in Gallery.

On Android 4.4+, scanning the whole card or a directory only picks up *new* files and the task waits till the scan is finished.