title: How to work withTimeout in Coroutine on Android
body: <p>In my application I want use <code>Coroutines</code> and I write simple code for check <code>withTimeout</code> function!<br>
  I write below codes, and I think after <strong>3sec</strong> stop my working and show me <strong>Done</strong> message!<br>
  But after <strong>3sec</strong> stop coroutines but <strong>not show me</strong> done message!<br></p>
  <p><strong>My Codes :</strong></p>
  <pre><code>CoroutineScope(Default).launch {
      Log.e(TAG, &quot;Start coroutine&quot;)
      withTimeout(3000) {
          for (i in 20..50) {
              if (isActive) {
                  delay(500)
                  Log.e(TAG, &quot;Show i =&gt; $i&quot;)
              }
          }
      }
      Log.e(TAG, &quot;Done coroutine&quot;)
  }
  </code></pre>
  <p><strong>Logcat messages :</strong></p>
  <pre><code>2022-02-05 18:08:11.891 12413-12484/my.app.coroutines E/CoroutinesTag: Start coroutine
  2022-02-05 18:08:12.399 12413-12484/my.app.coroutines E/CoroutinesTag: Show i =&gt; 20
  2022-02-05 18:08:12.900 12413-12485/my.app.coroutines E/CoroutinesTag: Show i =&gt; 21
  2022-02-05 18:08:13.404 12413-12491/my.app.coroutines E/CoroutinesTag: Show i =&gt; 22
  2022-02-05 18:08:13.905 12413-12486/my.app.coroutines E/CoroutinesTag: Show i =&gt; 23
  2022-02-05 18:08:14.406 12413-12491/my.app.coroutines E/CoroutinesTag: Show i =&gt; 24
  </code></pre>
  <p>Why not show me done (<strong>Done coroutine</strong>) message?</p>