Sdílet prostřednictvím


InputDevice.BatteryState Property

Definition

Gets the battery state object associated with the device, if there is one.

public Android.Hardware.BatteryState BatteryState { [Android.Runtime.Register("getBatteryState", "()Landroid/hardware/BatteryState;", "", ApiSince=31)] get; }
[<get: Android.Runtime.Register("getBatteryState", "()Landroid/hardware/BatteryState;", "", ApiSince=31)>]
member this.BatteryState : Android.Hardware.BatteryState

Property Value

The battery object associated with the device, never null.

Attributes

Remarks

Gets the battery state object associated with the device, if there is one. Even if the device does not have a battery, the result is never null. Use BatteryState#isPresent to determine whether a battery is present.

Java documentation for android.view.InputDevice.getBatteryState().

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