Sdílet prostřednictvím


PowerManager.IsInteractive Property

Definition

Returns true if the device is in an interactive state.

public virtual bool IsInteractive { [Android.Runtime.Register("isInteractive", "()Z", "GetIsInteractiveHandler")] get; }
[<get: Android.Runtime.Register("isInteractive", "()Z", "GetIsInteractiveHandler")>]
member this.IsInteractive : bool

Property Value

True if the device is in an interactive state.

Attributes

Remarks

Returns true if the device is in an interactive state.

When this method returns true, the device is awake and ready to interact with the user (although this is not a guarantee that the user is actively interacting with the device just this moment). The main screen is usually turned on while in this state. Certain features, such as the proximity sensor, may temporarily turn off the screen while still leaving the device in an interactive state. Note in particular that the device is still considered to be interactive while dreaming (since dreams can be interactive) but not when it is dozing or asleep.

When this method returns false, the device is dozing or asleep and must be awoken before it will become ready to interact with the user again. The main screen is usually turned off while in this state. Certain features, such as "ambient mode" may cause the main screen to remain on (albeit in a low power state) to display system-provided content while the device dozes.

The system will send a android.content.Intent#ACTION_SCREEN_ON screen on or android.content.Intent#ACTION_SCREEN_OFF screen off broadcast whenever the interactive state of the device changes. For historical reasons, the names of these broadcasts refer to the power state of the screen but they are actually sent in response to changes in the overall interactive state of the device, as described by this method.

Services may use the non-interactive state as a hint to conserve power since the user is not present.

Java documentation for android.os.PowerManager.isInteractive().

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

See also