title: Maybe in room not returning data but if i do query with aysnctask it returns data?
body: <p>I am trying to get data from room using maybe/Flowable  its returns nothing but if i try with AsyncTask its returns data .</p>
  
  <p><strong>Here my query:</strong></p>
  
  <pre><code>@Query("SELECT * FROM Media WHERE path LIKE :path")
  Maybe&lt;Media&gt; getMediaByPathTest(String path);
  </code></pre>
  
  <p><strong>and code in Activity:</strong></p>
  
  <pre><code>                AppDatabase.getInstance(getActivity()).mediaDao()
                      .getMediaByPathTest(getCurrentMedia().getPath())
                      .observeOn(Schedulers.io())
                      .subscribeOn(AndroidSchedulers.mainThread())
                      .subscribe(media -&gt; {
  
                                  if (media != null &amp;&amp; media.isFavourite()) {
                                      Toast.makeText(SingleMediaActivity.this,
                                              "Bingo I m favorite", Toast.LENGTH_SHORT).show();
                                  }
  
  
                              }, throwable -&gt; {
                              }
                              , () -&gt; {
                              });
  </code></pre>
  
  <p>its show error</p>
  
  <p>W/System.err: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.</p>
  
  <p>what i am doing wrong and how to do it right?</p>