I was just facing ANR(Activity Not Responding) problem. I resolved thought but that ANR suddenly triggers a question in my mind.....
When ANR Occurs ?
Reason: When your activity allocates lot of memory in background or UI is
blocked more than 5 seconds.
Who displays Alert Dialog ?
Our activity is a main thread and Main thread can update/manipulate any UI
elements. Showing Dialog is kind of change in UI.
My question is
Who is showing the ANR Alert Dialog?
Can anyone explain me ?
Now my question is if main thread is blocked as ANR error tells us, than how come OS can display ANR Alert dialog box on top of our Activity?