How to detect if user drag PIP window (drag down to dismiss)?

Viewed 321

What i need to do is detect if user drag down the PIP window (drag down to dismiss). When I do so, the onPictureInPictureModeChanged method is called

but how can i detect the dismiss specifically?

1 Answers

Whenever user drag to dismiss the PIP window onStop() is called.

just add these lines.

 @Override
protected void onStop() {
    //your code here
    player.release();
    super.onStop();
    Log.v(TAG, "onStop()...");
}
Related