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

int: Can be FULLSCREEN_MODE_REQUEST_ENTER or FULLSCREEN_MODE_REQUEST_EXIT to indicate this request is to get fullscreen or get restored. Value is one of the following: FULLSCREEN_MODE_REQUEST_EXIT FULLSCREEN_MODE_REQUEST_ENTER

approvalCallback
IOutcomeReceiver

OutcomeReceiver: 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 except on devices with API level 36.1 or lower, where the behavior is undefined. 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.

Android reference for android.app.Activity.requestFullscreenMode.

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