title: Getting illegalStateException when accessing coroutines in main thread
body: <p>I have written the code given below to fetch the data from local DB and update it to my recycler view. I am using <code>Dispatchers.IO</code> to fetch the data from DB and using <code>Dispatchers.main</code> to update my list in recycler view. But I am not able to access the dispatcher Main Module. I am calling the below function in my fragment:</p>
  
  <pre><code>viewLifecycleOwner.lifecycleScope.launch(Main) {
  
      eventList = withContext(IO) {
          shruthiDatabase.eventDao().getAllEvent() as ArrayList&lt;Event_Entity&gt;
      }
  
      if (eventList.isNotEmpty()) {
          eventAdapter!!.notifyDataSetChanged()
          eventRecycler.visibility = View.VISIBLE
          eventFound.visibility = View.GONE
      }
  }
  </code></pre>