On Tue, Jul 28, 2009 at 5:55 AM, SurtaX <[email protected]> wrote:
>
> I am trying to use MediaScannerConnection to update content provider
> of a newly downloaded MP3. However no matter what I do it does not
> seem to be able to connect. I have even put this chunk of code into
> onCreate and hardcoded to path of an existing file but still no dice.
>
> MediaScannerConnection scanner = new
> MediaScannerConnection(this,
> null);
You should give it a MediaScannerConnectionClient, not null.
scanner.connect();
> while(!scanner.isConnected()){
This won't work, because you're blocking the main thread, so the
MediaScannerConnection callback can never happen.
You either need to poll by posting messages to your main loop, or use the
MediaScannerConnectionClient callback interface.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---