title: How to observe LiveData changes from a Room Database using Data Binding Library
body: <p>First time implementing Room and Data Binding.</p>
  
  <p>In my <code>ViewModel</code>: </p>
  
  <pre><code>var numberOfClubs = ObservableInt(0)
  private var clubs: LiveData&lt;List&lt;Club&gt;&gt; = clubDao.getAllClubs()
  </code></pre>
  
  <p>I then try to get <code>clubs.value</code> after inserting into the Room database but am getting a <code>KotlinNullPointerException</code> every time.</p>
  
  <pre><code>fun addClubs() {
      Observable.fromCallable({
          clubDao.insertClubs(listOf(Club(null, "clubName"))
      })
          .subscribeOn(schedulerFacade.computation)
          .subscribe(
              {
                  numberOfClubs.set(clubs.value!!.size) &lt;--- Kotlin NPE
              },
              { error -&gt;
                  logWrapper.e("MainViewModel", error.message!!)
                  clubError.set(true)
              })
  }
  </code></pre>
  
  <p>In my XML I'm calling: <code>android:text="@{viewModel.numberOfClubs}"</code>.</p>
  
  <p>As inserting into the Room database doesn't cause anything to be returned, I can't set <code>numberOfClubs</code> with the result. I assumed that <code>clubs</code> should track the changes?</p>