android - my app consume high CPU -
My app is made up of four tabs: three scenes with a webview and some text / audit ... the problem is my app Consume too many CPUs and I do not understand why, and the main problem is that when the app is turned on (user uses the Home button), my app is still CPU (about 20% Or more!) And battery consumption.
I do not understand what the CPU uses so much, so I have two questions:
- How do I properly (with eclipse) process ( Method, activity ...) that use a lot of CPU?
- When I press the user's home button, how can I "freeze" with 0 CPU consumption (I think that is in onPause method, I try it with a full (), this work , But when the user returns to my app, he gets FC.)
Thank you very much!
Edit:
It seems that my webview consumes the CPU, how can I stop this webpage without destroying the webview object?
I am getting the solution:
The JavaScript content was problematic in the webview. To resolve this:
Prevent public null at @Override () {super.onPause (); / * Webview punctuation timer, if not, high CPU during pause * / page.pauseTimers (); }
and resume on,
resume at public zeros () {/ * reactive timer * / super.onResume (); Page.resumeTimers (); }
Comments
Post a Comment