In my app I have in the mainActivity intent that move mw to the second activity and in the second activity I have also intent that move me to the main activity.
Now when I press the back button in my phone it return’s me to the last activity that i was in but it not the problem, I already know how to disable pressing back button but I
dont want that when I move to another activity the last activity that I was in will keep running I want to stop it from running or either to complete kill it.
Any ideas?
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
2
Answers
You can achieve this by calling finish() in your second activity after starting MainActivity
Just call: