If the mainthread is unresponsive for a long time, the system will prompt "XXX unresponsive" and the user will be closed. So, how to locate the problem? No response is not like crash, it does not fetch the exception log, usually we need to debug in order to locate the problem. How to debug it?
1. In the Eclipse Devices window, select the package name for the app, then click the Debug icon (green bug) and switch to debug view
2. After switching the view, you can see the thread list of the app under Debug.
3. For the main thread (the first thread), select and suspend it suspend
4. Then we can see, after suspend, where the main thread is stuck:
As can be seen, when the main thread calls Pausebubbleandhide, Surfaceview cannot lockcanvas cause the page to get stuck. After the follow-up investigation found that before the use of this method, Lockcanvas and Unlockcanvasandpost did not appear in pairs, after the last lock, there is no unlock, according to Lockcanvas again, unable to respond. Then solve the problem.
The above describes the steps that the debugger does not respond to.
-------------------------------------------------------------------
more communication, Android Development Alliance QQ Group: 272209595
Android: The program is unresponsive, how do you locate the problem?