views:

257

answers:

1

In reviewing this post http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it, the highest rated answer says you should unregister and reregister the listener for the accelerometer onStop and onResume to conserve battery life.

My question is how do we know which listeners we need to stop/resume to minimize our applications footprint on battery life? Things like do OnClickListener, TextWatcher() etc - do they need to be changed?

and if anyone knows, what about adMob's SimpleAdListener?

I sort of assumed that the UI listeners don't consume battery if the Activity doesn't have focus. As for the SimpleAdListener I have no idea....

A: 

My question is how do we know which listeners we need to stop/resume to minimize our applications footprint on battery life? Things like do OnClickListener, TextWatcher() etc - do they need to be changed?

If it ties into hardware, you should consider unregistering the listener. Accelerometer, GPS, etc.

CommonsWare