Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up

Tags:

android

Please help me to understand what is meaning of below ANR? "Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."

like image 692
Ashish Avatar asked Jun 25 '15 21:06

Ashish


2 Answers

I think this happens when an activity is started but somehow it doesn't add any content view to interact with user. I also saw this error on developer console because there was an issue with app's framework and it used to get stuck on splash screen. The reason was the activity doesn't call setContentView by default but waits for the app framework to initialize, and when framework initialized completely it didn't add any view to activity because of a bug.

like image 90
Serdar Samancıoğlu Avatar answered Nov 11 '22 22:11

Serdar Samancıoğlu


Well, I am facing the same issue and this is what I come up with.

The log you mentioned: "Waiting because no window has focus but there is a "focused application that may eventually add a window when it finishes starting up."

is dispatched by the InputDispatcher.cpp from AOSP framework.

It happens when InputDispatcher is waiting for application to add a window to inject input. If the time waiting > 5000ms, then you will have an ANR.

like image 1
Banana droid Avatar answered Nov 11 '22 23:11

Banana droid