We have two apks A and B.
A starts B at onBackPressed.

Doing as steps below can make ANR:
1)starts emulator and A;
2)put one finger on A and hold on it;
3)press ESC to do back key action and B is started;
4)release finger on B

ANR will happens if we call finish() at onStop. And if we call
finish() after startActivity and everything is all right.

Below is log when ANR happens:
07-28 07:08:31.586 V/WindowManager(   52): Waiting for key dispatch:
5000

07-28 07:08:36.591 V/WindowManager(   52): Finished waiting @5174450
startTime=5169441 switchTime=0 target=Window{43e68d70
com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.First paused=true} mLW=null mLB=null
fin=true mCurrentFocus=Window{43ce5d28
com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.Second paused=false}

07-28 07:08:36.591 W/WindowManager(   52): Key dispatching timed out
sending to com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.First

07-28 07:08:36.614 W/WindowManager(   52): Dispatch state:
{{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to
Window{43ce5d28 com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.Second paused=false} @ 1280300903391
lw=Window{43ce5d28 com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.Second paused=false}
lb=android.os.binderpr...@43e6ed18 fin=false gfw=true ed=true tts=0
wf=false fp=false mcf=Window{43ce5d28
com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.Second paused=false}}}

07-28 07:08:36.614 W/WindowManager(   52): Current state:  {{null to
Window{43e68d70 com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.First paused=true} @ 1280300916617
lw=null lb=null fin=true gfw=true ed=true tts=0 wf=false fp=true
mcf=Window{43ce5d28 com.neusoft.test.FakeFinishOnStop/
com.neusoft.test.FakeFinishOnStop.Second paused=false}}}

07-28 07:08:36.632 I/ActivityManager(   52): ANR in process:
com.neusoft.test.FakeFinishOnStop (last in
com.neusoft.test.FakeFinishOnStop)

Is this a bug?

James

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to