开发者

Do i need to start and resume the OntouchListener?

I have attached the OnTouchListener with ImageView control, now my question is do i need to start and resume the listener (if possible) to save the resources, like we do in the case of other sensor devices like accelerelometer, compass etc? Or in case of Touch it wont require and it will not开发者_高级运维 put any effect on battery etc.


well if you let the listener attached to the imageview or not doesn't effect on the cpu or battery life. I mean of course have effect but that is not something that you should care, it is not like listeners of compas . . .

// you can do this button1.setOnTouchListener(null);

but I told you there is no need to unregister onTouch listeners.

If you are concerned for memory usage or cpu usage you should pay attention on other things. unregistering touch listener will not help to you application to be better or faster

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜