0

My goal is to show a pause dialog (which is a DialogFragment) in my activity when the entire app has been moved to the background and when it is brought to the foreground again I want to show this dialog.

The onRestart() method provides a solution. But onRestart() isn't called when I, for example, move the app to the background when the screen orientation is portrait, then change the orientation to landscape and bring the app to the foreground again. So onRestart() only works if the screen orientation remains the same.

Who has an idea to solve this problem?

Fred
  • 3
  • 1
  • Looks like a duplicate to me : http://stackoverflow.com/questions/4414171/how-to-detect-when-an-android-app-goes-to-the-background-and-come-back-to-the-fo – Francis Toth Aug 15 '15 at 13:11

1 Answers1

0

Use onPause and onResume methods

Deni Erdyneev
  • 1,779
  • 18
  • 26