How Do I Go Back to Previous Activity on Android?
Contents Answer #2: You Can Go Back to the Previous Activity by Just Calling Finish() in the Activity You Are On. Note Any Code After the Finish() Call Will Be...
Contents
Answer #2: You can go back to the previous activity by just calling finish() in the activity you are on. Note any code after the finish() call will be run – you can just do a return after calling finish() to fix this.
How do you close an activity on Android?
You have set android:noHistory = “true” for MainActivity inside AndroidManifest. xml which causes MainActivity to finish automatically on pressing the back key. Before switching to your ‘SettingsActivity’, you have called finish() in your MainActivity , which kills it.
Must Read
How do you finish an activity?
How to use finish method in android. app. Activity
- WeakReference mActivity;mActivity.get()
- Stack activityStack;activityStack.lastElement()
- (Activity) param.thisObject.