# enqueueWork

public static void enqueueWork(Context context, Class cls, int jobId, Intent work)

Call this to enqueue work for your subclass of RongJobIntentService. This will either directly start the service (when running on pre-O platforms) or enqueue work for it as a job (when running on O and later). In either case, a wake lock will be held for you to ensure you continue running. The work you enqueue will ultimately appear at onHandleWork.

#### Parameters

context

Context this is being called from.

cls

The concrete class the work should be dispatched to (this is the class that is published in your manifest).

jobId

A unique job ID for scheduling; must be the same value for all work enqueued for the same class.

work

The Intent of work to enqueue.

public static void enqueueWork(Context context, ComponentName component, int jobId, Intent work)

Like enqueueWork, but supplies a ComponentName for the service to interact with instead of its class.

#### Parameters

context

Context this is being called from.

component

The published ComponentName of the class this work should be dispatched to.

jobId

A unique job ID for scheduling; must be the same value for all work enqueued for the same class.

work

The Intent of work to enqueue.