title: How do I check if there's a certain item in database when using Room in Android?
body: <pre><code>@Dao
  interface ExampleDao {
  
      @Query("SELECT * FROM example_table WHERE id = :id")
      fun get(id: Int): LiveData&lt;Example&gt;
  
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      fun insert(something: Example)
  }
  
  </code></pre>
  
  <p>When I try to check if there's a certain row in the database using line below</p>
  
  <pre><code>val exists = dao.get(id).value != null
  if (exists) {
      ...
  }
  </code></pre>
  
  <p><strong>exists variable always return null</strong> I know there's the row already in the database and UI shows the info correctly.
  Why it always return null and how do I check if there's the row or not in the room database?</p>