On Wed, Jul 28, 2010 at 6:06 PM, Agus <[email protected]> wrote: > How to determine if the phone is powered by battery or by charger?
Call registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)). That will return the last Intent of that type that was broadcast. There are extras in there to indicate the charging state -- see BatteryManager for details. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 Available! -- 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

