Activity.OnPictureInPictureUiStateChanged(PictureInPictureUiState) Method

Definition

Called by the system when the activity is in PiP and has state changes.

[Android.Runtime.Register("onPictureInPictureUiStateChanged", "(Landroid/app/PictureInPictureUiState;)V", "GetOnPictureInPictureUiStateChanged_Landroid_app_PictureInPictureUiState_Handler", ApiSince=31)]
public virtual void OnPictureInPictureUiStateChanged (Android.App.PictureInPictureUiState pipState);
[<Android.Runtime.Register("onPictureInPictureUiStateChanged", "(Landroid/app/PictureInPictureUiState;)V", "GetOnPictureInPictureUiStateChanged_Landroid_app_PictureInPictureUiState_Handler", ApiSince=31)>]
abstract member OnPictureInPictureUiStateChanged : Android.App.PictureInPictureUiState -> unit
override this.OnPictureInPictureUiStateChanged : Android.App.PictureInPictureUiState -> unit

Parameters

pipState
PictureInPictureUiState

the new Picture-in-Picture state.

Attributes

Remarks

Called by the system when the activity is in PiP and has state changes.

Compare to #onPictureInPictureModeChanged(boolean, Configuration), which is only called when PiP mode changes (meaning, enters or exits PiP), this can be called at any time while the activity is in PiP mode. Therefore, all invocation can only happen after #onPictureInPictureModeChanged(boolean, Configuration) is called with true, and before #onPictureInPictureModeChanged(boolean, Configuration) is called with false. You would not need to worry about cases where this is called and the activity is not in Picture-In-Picture mode. For managing cases where the activity enters/exits Picture-in-Picture (e.g. resources clean-up on exit), use #onPictureInPictureModeChanged(boolean, Configuration).

The default state is everything declared in PictureInPictureUiState is false, such as PictureInPictureUiState#isStashed().

Java documentation for android.app.Activity.onPictureInPictureUiStateChanged(android.app.PictureInPictureUiState).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to