Cannot invoke observeForever on a background thread : <p>I've been using an <code>observeForever()</code> method as described <a href="https://stackoverflow.com/a/44991770/3499145">here</a> to test Room and LiveData for a while, and it has worked flawlessly. But when I changed to Android Studio 3.2 (or if it was the <code>androidx</code> refactoring, not sure), that method suddenly stopped working, throwing a </p>

<pre><code>java.lang.IllegalStateException: Cannot invoke observeForever on a background thread
</code></pre>

<p>How can we fix this?</p>
