Page 1 of 1

Add File to MediaStore & Trigger Media Scanner

Posted: 24 Jan 2016 08:48
by nomem
1. Add File to MediaStore
For example, how would I add an automagic created screenshot to the MediaStore? I found the following intent, but I don't know how to use it:
https://developer.android.com/reference ... .String%29

Ideally someone would answer with how to add any supported file to the MediaStore.

2. Trigger Media Scanner
How do I trigger a media scan for when I move a folder of media files?

Re: Add File to MediaStore & Trigger Media Scanner

Posted: 26 Jan 2016 13:50
by Martin
In the past (before KitKat 4.4) one could execute a media scan of the entire sd card by broadcasting intent with action android.intent.action.MEDIA_MOUNTED doc: http://developer.android.com/reference/ ... IA_MOUNTED

Following intent should still work to scan a file: http://developer.android.com/reference/ ... _SCAN_FILE

Regards,
Martin