ANR is a frequent timeout prompt for Android. I have read a post about ANR generated by mediaplayer during release. The author also developed a method, such as adding handler.
Finally, there was a solution. Let's take a look at some posts from that classmate.
Http://www.eoeandroid.com/forum.php? MoD = viewthread & tid = 55761 & page = 1 & authorid = 6510
ANR is generally looking for the scene where it occurred. The most important thing is the davlik thread log, which looks at the callstack of the framework layer.
The reason in this example is that the release of resources is not timely because the release of mediaplayer is not clear...
This problem also occurs when I solve the problem myself. The log is very similar to the ANR generated during the release, but my problem is that it came out during streaming.
In fact, ANR problems need to summarize the operation steps, ViewCodeIs the solution.
My problem is that when the player exits, nuplayer sends a teardown message, while myhander waits until the message is returned, and does not return for 20 s. the ANR output by the system.
Finally, a patch is added. If no response message is received within n seconds, you can force an End message.