Activity.SetShowWhenLocked(Boolean) Method

Definition

Specifies whether an Activity should be shown on top of the lock screen whenever the lockscreen is up and the activity is resumed.

[Android.Runtime.Register("setShowWhenLocked", "(Z)V", "GetSetShowWhenLocked_ZHandler", ApiSince=27)]
public virtual void SetShowWhenLocked (bool showWhenLocked);
[<Android.Runtime.Register("setShowWhenLocked", "(Z)V", "GetSetShowWhenLocked_ZHandler", ApiSince=27)>]
abstract member SetShowWhenLocked : bool -> unit
override this.SetShowWhenLocked : bool -> unit

Parameters

showWhenLocked
Boolean

true to show the Activity on top of the lock screen; false otherwise.

Attributes

Remarks

Specifies whether an Activity should be shown on top of the lock screen whenever the lockscreen is up and the activity is resumed. Normally an activity will be transitioned to the stopped state if it is started while the lockscreen is up, but with this flag set the activity will remain in the resumed state visible on-top of the lock screen. This value can be set as a manifest attribute using android.R.attr#showWhenLocked.

Java documentation for android.app.Activity.setShowWhenLocked(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