What is the equivalent operation within an activity to navigating away from the screen. Like when you press the back button, the activity goes out of view. How can this be call
finish() method is used to finish the activity and remove it from back stack. You can call it in any method in activity. But make sure you close all the Database connections, all reference variables null to prevent any memory leaks.