开发者

Android registerListener and battery life

In reviewing this post Android: I want to shake it, the highest rated answer says you should unregister and reregister the listener for the 开发者_Go百科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....


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜