Monday, September 19, 2011

[android-developers] Re: Receive Broadcast call when activity is paused

The UI is like this link Image
http://androidadvices.com/wp-content/uploads/2011/08/Connect-USB-Storage.png

On Sep 19, 1:53 pm, laminina <jennys.jen...@gmail.com> wrote:
> hello everybody!
>
> I created a BroadcastReceiver in my activity to receive when the
> Storage is unmounted, find an example code here:
> IntentFilter filter = new IntentFilter();
> filter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
>                 filter.addAction(Intent.ACTION_MEDIA_EJECT);
>             filter.addDataScheme("file");
> mmcReceiver = new USBStorageReceiver();
> registerReceiver(mmcReceiver, filter);
>
> where USBStorageReceiver is:
> private class USBStorageReceiver extends BroadcastReceiver {
>
>                 @Override
>                 public void onReceive(Context context, Intent intent) {
>                    handleCancelDownload();
>                 }
>
> }
>
> This code works fine in more than 20 devices so far. But the pattern
> I'm seeing in the device where it DOESN't work is that when we plug
> the USB and we want to connect to USB Storage Mode the UI interaction
> is where the USBActivity takes over of the whole screen (and is not a
> popup like other devices) and for this case I don't receive any
> onReceive() notification.!!!!
>
> Is there something different that needs to be done for this type of
> USB Activity interaction? why I don't receive the broadcast.
> Examples of this UI will be Droid2, Samsung Charge, Samsung
> Fascinate...a lot of Samsung devices.
>
> Thanks in advance. :)

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment