I want to know about ANR dialog in android applications and when it will happen and how to remove that. Please help me.
Asked
Active
Viewed 3,369 times
2 Answers
4
ANR - application not responding.
This dialog appears when the main thread of the application is blocked for too long, for example, when you sleep on this thread, or performing a long connection.
Avoiding it is done by moving the heavy operations to other threads. There's a great article regarding the ways to implement that - Painless Threading.

MByD
- 135,866
- 28
- 264
- 277
-
1The article seems to have been moved to: http://android-developers.blogspot.com/2009/05/painless-threading.html – ef2011 Oct 15 '12 at 02:10
2
It will happen when you spend too much time on the main application thread. To avoid ANR errors, ensure any long-running work occurs on a background thread.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491