mirogojcek
mirogojcek

Reputation: 81

Check if PIP is active

I have an app that runs foreground service. Is there any way to check if there are any PiP's currently active when:

  1. I'm in my app and pip is overlaying it

  2. 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

Answers (1)

Oded Regev
Oded Regev

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

Related Questions