@TreKing Thanks for your replies. We do have some reasons to call finish because Android did not finish one when another is shown before it. >Probably, but with your code, not Android. Document does not say finish is not allowed to be called at onStop. How to explain there is no problem with calling finish just after startActivity.
@Dianne Thanks for your replies. We do believe it is a problem with framework. WindowManagerService.java: private int dispatchPointer(QueuedEvent qev, MotionEvent ev, int pid, int uid) { if (DEBUG_INPUT || WindowManagerPolicy.WATCH_POINTER) Log.v(TAG, "dispatchPointer " + ev); if (MEASURE_LATENCY) { lt.sample("3 Wait for last dispatch ", System.nanoTime() - qev.whenNano); } Object targetObj = mKeyWaiter.waitForNextEventTarget(null, qev, ev, true, false, pid, uid); When calling finish() after startActivity, mKeyWaiter.waitForNextEventTarge returns activity A. And after checking A.isVisibleLW(), the key up event is discarded successfully. When calling finish() at onStop, ANR happens in mKeyWaiter.waitForNextEventTarge and it is seems never get out. James -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en