Google-apps
Hoofdmenu

Post a Comment On: Bram, INDIEvidual in Canada

"ANR: Application Not Responding (keyDispatchingTimedOut)"

4 Comments -

1 – 4 of 4
Blogger Bram said...

I have added a 'hasEvents' check, because on some devices a TTY spew of 'Failed to receive dispatch signal.' would ensue due to EWOULDBLOCK errors.

January 18, 2013 at 4:33 PM

Anonymous Anonymous said...

Thank you the

android.app.NativeActivity (client)' ~ Failed to receive dispatch signal. status=-11

errors were killing me, after adding your modifications to the android_native_app_glue.c all is well.

September 28, 2013 at 9:16 AM

Anonymous Anonymous said...

Thanks for this fix!

February 24, 2014 at 8:32 PM

Blogger Unknown said...

WARNING! Be careful with this "fix"

Unfortunately it seems to cause ANR on some (or all) 2.3 devices, e.g. HTC Desire HD or Nexus One when pressing Volume Keys.

Looks like on 2.3.x you have to explicitly call AInputQueue_getEvent, otherwise it may happen that hasEvents returns false and you won't have your process_input called again and the system won't give you again an event that should be predispatched.

So, unfortunately on <4.0 devices, you have to live with the spammed log if you don't want to risk ANR-s.

My loop looks like this:

int getEventResult = -1;

while (AInputQueue_hasEvents (app->inputQueue) || (getEventResult = AInputQueue_getEvent (app->inputQueue, &event)) >= 0)
{
if (getEventResult < 0)
{
getEventResult = AInputQueue_getEvent (app->inputQueue, &event);
}

if (getEventResult >= 0)
{
[...standard_handling...]
getEventResult = -1;
}
}

March 28, 2014 at 4:06 AM

You can use some HTML tags, such as <b>, <i>, <a>

You will be asked to sign in after submitting your comment.
Please prove you're not a robot