0

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()?

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

1 Answers1

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