Skip to content Skip to sidebar Skip to footer

Prevent Usb_device_attached Launching App After A Reboot

I have an activity listening for the USB_DEVICE_ATTACHED broadcast intent, which launches when the user plugs in my USB device and selects our app. My problem is the android host d

Solution 1:

I don't think you have enough information to determine if the USB_DEVICE_ATTACHED broadcast is due to your user plugging something in, or the device rebooting itself.

What I would do is launch the Activity in any case and have the Activity close itself if the user hasn't performed any action within a certain period of time (1 minute or 10 minutes or whatever).

Post a Comment for "Prevent Usb_device_attached Launching App After A Reboot"