Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android OS thinks app is not responding when at breakpoint during debug

Tags:

android

I'm not sure if this is an issue with Android studio 2.0 or if its because of some weird project setting in this new App I'm working on. When I am stopped at a break point during debug, the OS shows me a dialog saying that the app is not responding, and giving me the option to either wait or kill the app. then after a while, or if I don't respond to the dialog, it kills the app without my command.

I've never seen this before, usually the Android OS knows that the app is in debug mode and doesn't freak out when it's not responding. I tried setting the app as the debug app in Developer settings.

This things that changed: new project (previously created) , Android Studio upgraded to 2.0. It's the same phone I always use.

like image 685
Siavash Avatar asked Oct 31 '22 04:10

Siavash


1 Answers

For me the problem was related to a service running in background.

My service executes a background task every 5 minutes, so if the breakpoint "pauses" the main thread, the service tries to run and show the Not Responding popup. Ten seconds later, if we are still in the breakpoint, the system shows that annoying popup over and over again.

I more detailed description of my problem can be found here: https://stackoverflow.com/a/38771413/4624524

like image 152
Felipe Andrade Avatar answered Nov 11 '22 10:11

Felipe Andrade