Check if WorkManager is scheduled already : <p><strong>How can I check if <code>WorkManager</code> is scheduled already.</strong></p>

<p>Here is my code that schedule <code>WorkManager</code>.</p>

<pre><code>public static void scheduleWork() {
    PeriodicWorkRequest.Builder photoCheckBuilder =
            new PeriodicWorkRequest.Builder(WorkManagerService.class, TIME_INTERVAL_IN_SECONDS,
                    TimeUnit.SECONDS);
    PeriodicWorkRequest photoCheckWork = photoCheckBuilder.build();
    WorkManager instance = WorkManager.getInstance();
    if (instance != null) {
        instance.enqueueUniquePeriodicWork("TAG", ExistingPeriodicWorkPolicy.KEEP , photoCheckWork);
    }
}
</code></pre>

<p>I call <code>scheduleWork()</code> in <code>onCreate()</code> of my <code>Application</code> class. 
Even I can check my service is running or not by <strong><a href="https://stackoverflow.com/a/5921190/6891563">this method</a></strong>. But I don't want schedule WorkManager if it is already scheduled to remove inconsistency in scheduled time.</p>

<p>Like </p>

<pre><code>if(!workManagerIsScheduled())
   {
     scheduleWork();
   }
</code></pre>

<p>Any solutions?</p>
