Skip to content

Instantly share code, notes, and snippets.

@halilozercan
Created January 16, 2020 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halilozercan/6f6c13c44d13380f90ec755a7e07643f to your computer and use it in GitHub Desktop.
Save halilozercan/6f6c13c44d13380f90ec755a7e07643f to your computer and use it in GitHub Desktop.
override fun onPictureInPictureModeChanged(
isInPictureInPictureMode: Boolean,
newConfig: Configuration
) {
if (isInPictureInPictureMode) {
// entered PiP
} else {
// keep track of background in onStart and onStop
if (inBackground) {
// User highly probably finished the activity in PiP.
// execute finish logic
finish()
}
// exited PiP
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment