Android 4.0.3 and finish activity
Asked Answered
E

2

7

I have and Activity A calling Activity B. Then Activity B dials a number and then on the IDLE-OFFHOOK- IDLE state I call ActivityB.this.finish() so that activity A shows on front.

This all worked fine from Android 2.3.x till version 4.0.

Now it doesn't work on android 4.0.3 emulator and 4.0.2. Why?

Can someone help?

Effulgence answered 4/3, 2012 at 2:31 Comment(2)
"doenst work" is a useless statement.Farika
Just a guess but try this.finish() only. Anyhow a little insight into your code would be nice. And as mentioned a clear description.Hartley
K
0

It might be the case that you have overridden onDestroy method and it is falling over because of an Exception (only occurring in 4.0), which is preventing the Activity from closing properly. Also just try to invoke finish() simply on Activity B.

Kierkegaardian answered 15/5, 2012 at 9:40 Comment(0)
T
0

Better solution for this case is to use startActivityForResult.

You can switch activity from A to B, in activity B do your work and handle results in activity A at override method onActivityResult().

Teresitateressa answered 29/4, 2016 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.