I am reading ANR
. Most of things make sense to me but i can not understand that if Main thread is blocked then How OS create a Dialog
in same process and show it on screen . From the Documentation:
An ANR will be triggered for your app when one of the following conditions occur:
1. While your activity is in the foreground, your app has not responded to an input event orBroadcastReceiver
(such as key press or screen touch events) within 5 seconds.
2. While you do not have an activity in the foreground, yourBroadcastReceiver
hasn't finished executing within a considerable amount of time.
i.e The main thread is in a deadlock with another thread So how the OS manage to show a dialog . Cause i think we can only show dialog from a main thread. Please correct me if i am wrong and let me know the process of ANR
dialog.
Any explanation will be really appreciated. Thx