Compartilhar via


BatteryManager.ComputeChargeTimeRemaining Method

Definition

Compute an approximation for how much time (in milliseconds) remains until the battery is fully charged.

[Android.Runtime.Register("computeChargeTimeRemaining", "()J", "GetComputeChargeTimeRemainingHandler", ApiSince=28)]
public virtual long ComputeChargeTimeRemaining ();
[<Android.Runtime.Register("computeChargeTimeRemaining", "()J", "GetComputeChargeTimeRemainingHandler", ApiSince=28)>]
abstract member ComputeChargeTimeRemaining : unit -> int64
override this.ComputeChargeTimeRemaining : unit -> int64

Returns

how much time is left, in milliseconds, until the battery is fully charged or -1 if the computation fails

Attributes

Remarks

Compute an approximation for how much time (in milliseconds) remains until the battery is fully charged. Returns -1 if no time can be computed: either there is not enough current data to make a decision or the battery is currently discharging.

Java documentation for android.os.BatteryManager.computeChargeTimeRemaining().

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