> Is it possible to know when the user unplugs a charger or headsets
> from the device so I can trigger something...

In general, there is no way to read the USB state. For particular types of
things, though, there are broadcast Intents you can monitor. For example,
ACTION_BATTERY_CHANGED will let you know when the device goes on and off a
charger, and ACTION_HEADSET_PLUG will let you know when a headset is
plugged or unplugged.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to