Oh man.. after 3 days of searching and bothering a couple people ive
finally found the solution.. this one line of code:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse
("file://"
                        + Environment.getExternalStorageDirectory())));

thats it.. it sends an intent on which the mediascanner starts itself,
and voila, the whole external storage searched for media.. find new
items, deletes the ones that dont exist anymore.

On Nov 2, 12:49 pm, Pavol Ban <zum...@gmail.com> wrote:
> Hi everyone,
>
> i've already been searching forums and google groups to find out how
> to forceMediaScannerto rescan the sd-card formediafiles, but with
> no luck. So after 2 days of searching i decided to post a question
> here.
>
> In my app i need to renamemediafiles, change their extension, or to
> reveal them by changing back their extension, but the changes take
> effect only after i runMediaScannerfrom the dev-tools, or remount
> the image, or reboot the phone/emulator. I've tried using
> MediaScannerConnection, and it only works when revealingmediafiles,
> but not refreshing the gallery / music player thumbnails which is the
> biggest problem in my app development right now.
>
> I've also tried copying files and deleting the old ones, but that has
> no effect also..
>
> Does anyone have any experience with this? Any help is greatly
> appreciated..
>
> Thanks!
> Paul

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to