Share via


Activity.SetTurnScreenOn(Boolean) Method

Definition

Specifies whether the screen should be turned on when the Activity is resumed.

[Android.Runtime.Register("setTurnScreenOn", "(Z)V", "GetSetTurnScreenOn_ZHandler", ApiSince=27)]
public virtual void SetTurnScreenOn (bool turnScreenOn);
[<Android.Runtime.Register("setTurnScreenOn", "(Z)V", "GetSetTurnScreenOn_ZHandler", ApiSince=27)>]
abstract member SetTurnScreenOn : bool -> unit
override this.SetTurnScreenOn : bool -> unit

Parameters

turnScreenOn
Boolean

true to turn on the screen; false otherwise.

Attributes

Remarks

Specifies whether the screen should be turned on when the Activity is resumed. Normally an activity will be transitioned to the stopped state if it is started while the screen if off, but with this flag set the activity will cause the screen to turn on if the activity will be visible and resumed due to the screen coming on. The screen will not be turned on if the activity won't be visible after the screen is turned on. This flag is normally used in conjunction with the android.R.attr#showWhenLocked flag to make sure the activity is visible after the screen is turned on when the lockscreen is up. In addition, if this flag is set and the activity calls KeyguardManager#requestDismissKeyguard(Activity, KeyguardManager.KeyguardDismissCallback) the screen will turn on.

Java documentation for android.app.Activity.setTurnScreenOn(boolean).

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