Android.OS.PowerManager.GoToSleep Method
Forces the device to go to sleep.

Syntax

[Android.Runtime.Register("goToSleep", "(J)V", "GetGoToSleep_JHandler")]
public virtual void GoToSleep (long time)

See Also

PowerManager.UserActivity(long, System.Boolean)
PowerManager.WakeUp(long)

Parameters

time
The time when the request to go to sleep was issued, in the SystemClock.UptimeMillis time base. This timestamp is used to correctly order the go to sleep request with other power management functions. It should be set to the timestamp of the input event that caused the request to go to sleep.

Remarks

Forces the device to go to sleep.

Overrides all the wake locks that are held. This is what happens when the power key is pressed to turn off the screen.

Requires the Android.Manifest.Permission.DevicePower permission.

[Android Documentation]

Requirements

Namespace: Android.OS
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1