title: Android WorkManager - CoroutineWorker: Overriding coroutineContext is deprecated
body: <p>I use the <a href="https://developer.android.com/topic/libraries/architecture/workmanager/" rel="noreferrer">WorkManager</a> version 2.2.0 to start a Coroutines API Call when the user gets online again.</p>
  
  <p><a href="https://developer.android.com/topic/libraries/architecture/workmanager/advanced/coroutineworker" rel="noreferrer">In the example by Google</a>, if I want to change the Thread of my CoroutineWorker from the default (<code>Dispatchers.Default</code>) to <code>Dispatchers.IO</code>, then I simply have to override the <code>val</code> <code>coroutineContext</code> such as:</p>
  
  <pre><code>class CoroutineDownloadWorker(context: Context, params: WorkerParameters) : CoroutineWorker(context, params) {
  
      override val coroutineContext = Dispatchers.IO
  
      override suspend fun doWork(): Result = coroutineScope {
           // do some work here and return a Result
      }
  }
  </code></pre>
  
  <p>But Android Studio and <a href="https://developer.android.com/reference/kotlin/androidx/work/CoroutineWorker#coroutinecontext" rel="noreferrer">the Docs</a> tell me, that overriding <code>coroutineContext</code> is deprecated:</p>
  
  <p><a href="https://i.stack.imgur.com/jcpPa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jcpPa.png" alt="enter image description here"></a></p>
  
  <p>What am I missing and how can I resolve this issue?</p>