Language

DownloadManager.Request.SetRequiresCharging(Boolean) Method

Definition

Sets whether the download requires the system's charging constraint.

[Android.Runtime.Register("setRequiresCharging", "(Z)Landroid/app/DownloadManager$Request;", "GetSetRequiresCharging_ZHandler", ApiSince=24)]
public virtual Android.App.DownloadManager.Request? SetRequiresCharging(bool requiresCharging);
[<Android.Runtime.Register("setRequiresCharging", "(Z)Landroid/app/DownloadManager$Request;", "GetSetRequiresCharging_ZHandler", ApiSince=24)>]
abstract member SetRequiresCharging : bool -> Android.App.DownloadManager.Request
override this.SetRequiresCharging : bool -> Android.App.DownloadManager.Request

Parameters

requiresCharging
Boolean

Whether the download requires the system's charging constraint.

Returns

This Android.App.DownloadManager.Request instance, allowing calls to be chained.

Attributes

Remarks

Sets whether the download requires the system's charging constraint. This defaults to false. The constraint uses SetRequiresCharging(Boolean). On Android 10 and later, a battery-powered device that is connected to power but still discharging does not meet the constraint.

Android reference for android.app.DownloadManager.Request.setRequiresCharging.

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