Add File to MediaStore & Trigger Media Scanner

Post your questions and help other users.

Moderator: Martin

Post Reply
nomem
Posts: 1
Joined: 24 Jan 2016 08:36

Add File to MediaStore & Trigger Media Scanner

Post by nomem » 24 Jan 2016 08:48

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?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Add File to MediaStore & Trigger Media Scanner

Post by Martin » 26 Jan 2016 13:50

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

Post Reply