user519846
user519846

Reputation: 1009

Android ANR keyDispatchingTimedOut Error while continuous tapping on screen

I am getting Application Not Responding (ANR) dialog while continuous tapping on the screen. There is no view on the screen where i am tapping. Frequency of this issue is less but still i am not able to remove it completely.

Here i am attaching the log what i caught during this error.

ERROR/ActivityManager(1322): ANR in com.test.mj.and.ui     (com.test.mj.and.ui/.TermsAndCondActivity)
ERROR/ActivityManager(1322): Reason: keyDispatchingTimedOut
ERROR/ActivityManager(1322): Parent: com.test.mj.and.ui/.SplashActivity
ERROR/ActivityManager(1322): Load: 6.59 / 6.37 / 5.21
ERROR/ActivityManager(1322): CPU usage from 11430ms to 2196ms ago:
ERROR/ActivityManager(1322):   rtal.mj.and.ui: 9% = 7% user + 1% kernel / faults: 649  minor
ERROR/ActivityManager(1322):   system_server: 4% = 2% user + 2% kernel / faults: 10 minor
ERROR/ActivityManager(1322):   logcat: 3% = 1% user + 1% kernel / faults: 675 minor 1  major
ERROR/ActivityManager(1322):   synaptics_wq: 1% = 0% user + 1% kernel
ERROR/ActivityManager(1322):   ami304d: 1% = 0% user + 0% kernel
ERROR/ActivityManager(1322):   .process.lghome: 1% = 0% user + 0% kernel / faults: 47 minor
ERROR/ActivityManager(1322):   sync_supers: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322):   droid.DunServer: 0% = 0% user + 0% kernel / faults: 6 minor
ERROR/ActivityManager(1322):   events/0: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322):   oid.inputmethod: 0% = 0% user + 0% kernel / faults: 2 minor
ERROR/ActivityManager(1322):   m.android.phone: 0% = 0% user + 0% kernel / faults: 2 minor
ERROR/ActivityManager(1322):   ndroid.settings: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322):   sh: 0% = 0% user + 0% kernel / faults: 110 minor
ERROR/ActivityManager(1322):  -flush-179:0: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322): TOTAL: 19% = 13% user + 6% kernel
WARN/WindowManager(1322): Continuing to wait for key to be dispatched
WARN/WindowManager(1322): No window to dispatch pointer action 1

Can anyone please help me to solve this issue?

Thanks in advance.

Upvotes: 9

Views: 15585

Answers (4)

Rajesh Narwal
Rajesh Narwal

Reputation: 898

If you are doing a resource intensive task then it might happen. While resuming the Activity.

  • Try stopping all your intensive work on onPause and then restarting it on onResume. If you are showing map on Activity drawing overlay on it then stop refreshing the overlays while on sleep and and refresh it on onResume. Use Threads for intensive tasks.

Upvotes: 0

Ruchi
Ruchi

Reputation: 441

There is limitation of 100kb data to pass from one activity to another. If it exeed the limit, the stated error comes.

Here's http://demetrimiller.com/2010/11/09/android-binder-transaction-failed-error-message/

I got the same error when I passed a huge arraylist. This arraylist, I was, getting it from the server. So try this. May be it solves your problem.

Upvotes: 0

Knickedi
Knickedi

Reputation: 8787

As stated in this answer before: That happens if a click, touch, key, etc. event is blocking the UI thread.

Funny enough, the same thing happened to me and it was also (very) infrequent. My problem was a binary search based on float values (not intended and very stupid ;-). Sometimes the search criteria doesn't change anymore so I got an infinite loop.

My suggestion: if you never intended to do heavy work which might block the UI thread, try to search for a possible infinite loop in your code.

Upvotes: 1

Dileep
Dileep

Reputation: 775

It usually happens in onClick handler doing some time consuming activity like getting resource from network or computing something complex. Use separate thread for that (UI thread) so that onclick handler can return and Window manager will continue.

http://developer.android.com/resources/articles/painless-threading.html

you can use Asynctask or postDelayed on view

Upvotes: 3

Related Questions