Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: go back to previous activity? [duplicate]

Tags:

android

Is there a way I can force the user to go back to the previous Activity? I'd like to kill my current Activity make the user "go back" possible?

like image 812
Skizit Avatar asked Nov 29 '22 18:11

Skizit


2 Answers

Call finish in your Activity : http://d.android.com/reference/android/app/Activity.html#finish()

And to make sure you started your activity correctly to have the state in the Activity Stack, check the documentation there : http://d.android.com/guide/topics/fundamentals/tasks-and-back-stack.html

like image 115
Matthieu Avatar answered Dec 05 '22 03:12

Matthieu


Call finish()

From the link: Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult().

like image 42
nicholas.hauschild Avatar answered Dec 05 '22 03:12

nicholas.hauschild



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!