Created
October 14, 2022 06:58
-
-
Save tfaki/63f36f940494d0b34eabb3af73341300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onUserLeaveHint() { | |
super.onUserLeaveHint() | |
//when user presses home button, if not in PIP mode, enter in PIP, requires Android N and above | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){ | |
Log.d(TAG, "onUserLeaveHint: was not in PIP") | |
pictureInPictureMode() | |
} | |
else{ | |
Log.d(TAG, "onUserLeaveHint: Already in PIP") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment