My app has three activities, A, B and C. I am moving from A to B through an OK button, and I want to move back from B to A by using the default back button of Android devices. When I press the button, though, the entire app gets closed. How can I get around this problem?
Share
I suspect you call
finish()in your OK button onclick listener. Don’t do that.finish()removes your activity from activity stack.Read more here.