Język

JobInfo.Builder.SetPrefetch(Boolean) Method

Definition

Setting this to true indicates that this job is designed to prefetch content that will make a material improvement to the experience of the specific user of this device.

[Android.Runtime.Register("setPrefetch", "(Z)Landroid/app/job/JobInfo$Builder;", "", ApiSince=28)]
public Android.App.Job.JobInfo.Builder? SetPrefetch(bool prefetch);
[<Android.Runtime.Register("setPrefetch", "(Z)Landroid/app/job/JobInfo$Builder;", "", ApiSince=28)>]
member this.SetPrefetch : bool -> Android.App.Job.JobInfo.Builder

Parameters

prefetch
Boolean

true to mark the job as prefetch work intended to improve this user's experience; false to clear that flag.

Returns

This builder instance.

Attributes

Remarks

Setting this to true indicates that this job is designed to prefetch content that will make a material improvement to the experience of the specific user of this device. For example, fetching top headlines of interest to the current user.

Apps targeting Android version Build.VERSION_CODES.TIRAMISU or later are not allowed to have deadlines (set via setOverrideDeadline(long)) on their prefetch jobs.

The system may use this signal to relax the network constraints you originally requested, such as allowing a JobInfo.NETWORK_TYPE_UNMETERED job to run over a metered network when there is a surplus of metered data available. The system may also use this signal in combination with end user usage patterns to ensure data is prefetched before the user launches your app.

Android reference for android.app.job.JobInfo.Builder.setPrefetch.

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