Android ANR and missing logs in traces.txt file
The ANR occurs for my application for some undefined reasons I'd开发者_StackOverflow中文版 like to figure out. Unfortunately there is not stack trace in traces.txt file. Is there any reason why there is nothing about my app in traces.txt? There are other applications' stack but mine.
Is there any other way to figure out what cause ANR except traces.txt and DDMS traces, which unfortunately show nothing when my app hangs. I am not also able to use Debug.startMethodTracing as I am not able to call stoptMethodTracing as I do not know when it hangs.
It happens on Android Froyo
Best Regards,
You could temporarily make your application very noisy in the logs, constantly telling you what it is doing. Then you see what it was doing last.
It might be better though just to read through your code and look for any place where you do potentially time-consuming processing or a potentially blocking i/o operation in the UI thread. If you find any you will need to move them out of the UI thread, regardless if they are the cause of the current ANR or not.
精彩评论