ANR keyDispatchingTimedOut error

旧时模样 提交于 2019-11-26 22:08:48

ANR Error

Activity Not Responding.

Your activity took to long to say to the Android OS 'hey i'm still alive'! (This is what the UI thread does).

http://developer.android.com/guide/practices/design/responsiveness.html

Basically if you make the UI thread do some complex task it's too busy doing your task to tell the OS that it is still 'alive'.

http://android-developers.blogspot.co.uk/2009/05/painless-threading.html

You should move your XML Parsing code to another thread, then use a callback to tell the UI thread you have finished and to do something with the result.

http://developer.android.com/resources/articles/timed-ui-updates.html

If Logcat doesn't output anything usefull, try to pull traces.txt from /data/anr/traces.txt

adb pull /data/anr/traces.txt .

as it may give more information on where the ANR Exception occurrred

Don't run blocking operations on the UI thread. Launch your own thread or use the AsyncTask class for a more convenient way to solve this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!