Check if WorkRequest has been previously enquequed by WorkManager Android : <p>I am using PeriodicWorkRequest to perform a task for me every 15 minutes.
I would like to check, if this periodic work request has been previously scheduled. If not, schedule it.</p>

<pre><code>     if (!PreviouslyScheduled) {
        PeriodicWorkRequest dataupdate = new PeriodicWorkRequest.Builder( DataUpdateWorker.class , 15 , TimeUnit.MINUTES).build();
        WorkManager.getInstance().enqueue(dataupdate);
      }
</code></pre>

<p>Previously when I was performing task using JobScheduler, I used to use </p>

<pre><code>public static boolean isJobServiceScheduled(Context context, int JOB_ID ) {
    JobScheduler scheduler = (JobScheduler) context.getSystemService( Context.JOB_SCHEDULER_SERVICE ) ;

    boolean hasBeenScheduled = false ;

    for ( JobInfo jobInfo : scheduler.getAllPendingJobs() ) {
        if ( jobInfo.getId() == JOB_ID ) {
            hasBeenScheduled = true ;
            break ;
        }
    }

    return hasBeenScheduled ;
}
</code></pre>

<p>Need help constructing a similar module for work request to help find scheduled/active workrequests.</p>
