Search code examples
androiddebuggingandroid-studiotimeoutandroid-broadcastreceiver

Debugging Android BroadcastReceiver onReceive() method in Android Studio


I am new to Android development. I am using Android Studio 2.2.3 When I try to debug what happens when a class extends BroadcastReceiver and the onReceive() method is called I cannot because there is a timeout. I see this in the logs.

Thread[5,tid=13474,WaitingInMainSignalCatcherLoop,Thread*=0xf3c30c00,peer=0x12c0a0a0,"Signal Catcher"]: reacting to signal 3

I understand from the docs that this is necessary because everything there has to happen fast, but is there no way of extending this timout period for debugging? The code does not take a long time to run I just need more time in order to debug it.

My OS is Windows 10.


Solution

  • This is somewhere between a work-around and a solution, but it works for me.
    I went to the emulated device's Settings -> Developer Options and enabled "Show all ANRs" and now a warning appears "Your application is not responding" and I can tap "WAIT" and it seems to work.