Go back to previous activity
Its every common query how to go back to previous activity.
Most of us will finish activity or keep track of the activity stack and all.
But no need of this type of complex logic if you need just the same effect of user’s back key press
You can use the android onBackPressed() method explicitly .


The default implementation simply finishes the current activity, but you can override this to do whatever you want.
The android implicitly call this method when the activity has detected the user’s press of the back key.
So calling this explicitly will give the same effect

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply