i have main activity and login screen..on pressing login button in main activity login screen will be displayed...i have a separate back button on login screen on pressing that button it goes back to main Activity...now if i back press in Main Activity i want to close the application..How can i do that?
i have written a code
public void onBackPressed() {
finsh()
}
but this is working when i first open main activity and back press it closes the app...but if i press login button...go to login screen and come back to main activity and back press it comes back to login screen.. please help
0 comments:
Post a Comment