Reputation: 81
I have an app that runs foreground service. Is there any way to check if there are any PiP's currently active when:
I'm in my app and pip is overlaying it
I'm in launcher and pip is active
If so, is it also possible to interact with them in any way, like closing when I enter my app or even get their position on screen?
Upvotes: 8
Views: 2357
Reputation: 4405
Activity has a method for that. Check out https://developer.android.com/reference/android/app/Activity#isInPictureInPictureMode()
public boolean isInPictureInPictureMode ()
Returns true if the activity is currently in picture-in-picture mode.
Upvotes: 1