Activity.RequestFullscreenMode Method

Definition

Request to put the activity into fullscreen.

[Android.Runtime.Register("requestFullscreenMode", "(ILandroid/os/OutcomeReceiver;)V", "GetRequestFullscreenMode_ILandroid_os_OutcomeReceiver_Handler", ApiSince=34)]
public virtual void RequestFullscreenMode (Android.App.FullscreenModeRequest request, Android.OS.IOutcomeReceiver? approvalCallback);
[<Android.Runtime.Register("requestFullscreenMode", "(ILandroid/os/OutcomeReceiver;)V", "GetRequestFullscreenMode_ILandroid_os_OutcomeReceiver_Handler", ApiSince=34)>]
abstract member RequestFullscreenMode : Android.App.FullscreenModeRequest * Android.OS.IOutcomeReceiver -> unit
override this.RequestFullscreenMode : Android.App.FullscreenModeRequest * Android.OS.IOutcomeReceiver -> unit

Parameters

request
FullscreenModeRequest

Can be #FULLSCREEN_MODE_REQUEST_ENTER or #FULLSCREEN_MODE_REQUEST_EXIT to indicate this request is to get fullscreen or get restored.

approvalCallback
IOutcomeReceiver

Optional callback, use null when not necessary. When the request is approved or rejected, the callback will be triggered. This will happen before any configuration change. The callback will be dispatched on the main thread. If the request is rejected, the Throwable provided will be an IllegalStateException with a detailed message can be retrieved by Throwable#getMessage().

Attributes

Remarks

Request to put the activity into fullscreen. The requester must be pinned or the top-most activity of the focused display which can be verified using #onTopResumedActivityChanged(boolean). The request should also be a response to a user input. When getting fullscreen and receiving corresponding #onConfigurationChanged(Configuration) and #onMultiWindowModeChanged(boolean, Configuration), the activity should relayout itself and the system bars' visibilities can be controlled as usual fullscreen apps.

Calling it again with the exit request can restore the activity to the previous status. This will only happen when it got into fullscreen through this API.

Java documentation for android.app.Activity.requestFullscreenMode(int, android.os.OutcomeReceiver<java.lang.Void, java.lang.Throwable>).

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