I am a beginner in Android app development, and I have a problem with an old app. I have to close an activity that is open over another activity: for example, a pop up that is open on top of the main app. How I close the popup and return false without exiting the main program, using the mobilePhone button onBackPressed()
?
Asked
Active
Viewed 44 times
0

i alarmed alien
- 9,412
- 3
- 27
- 40

T.G.Cat
- 1
1 Answers
0
You can override the onBackPressed
method like this:
public void onBackPressed(){
// If you have a reference to the other activity.
popupActivity.finish();
}

Kyle Emmanuel
- 2,193
- 1
- 15
- 22