title: Room- LiveData RxJava triggered without reason
body: <p>I have an Activity, ViewModel, Singleton repository and Room.
  In activitiy's <code>OnCreate</code> I create the ViewModel:</p>
  
  <pre><code>viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
  viewModel.myData.observe(this, Observer { data -&gt;
          Log.d("livedata","triggred")
     })
  </code></pre>
  
  <p>MainViewModel:</p>
  
  <pre><code>class MyWorkoutViewModel (application: Application) : AndroidViewModel(application) {
      // Getting the singleton repository
      private var repository = (application as MyApp).repository
  
      val myData: LiveData&lt;Int&gt; by lazy {
          repository.getData()
      }
  }
  </code></pre>
  
  <p>Respository has this function:</p>
  
  <pre><code>fun getData(): LiveData&lt;Int&gt; {
      return LiveDataReactiveStreams.fromPublisher(database.myDao()
              .observeData())
  }
  </code></pre>
  
  <p>MyDao:</p>
  
  <pre><code>@Query("SELECT COUNT(*) FROM my_table")
  fun fetchData(): Flowable&lt;Int&gt;
  </code></pre>
  
  <p>I have a very strange behavior:
  First time when the activity is created the data is fetched fine and everything works. After that I launch second activity while MainActivity remains paused. After returning to the main activity, for no visible reason the LiveData is triggered again.</p>
  
  <p>I tried to switch <code>LiveDataReactiveStream</code> to just <code>database.myDao().observeData()</code> and returning <code>LiveData</code> in Dao instead of <code>Flowable</code> and it fixed the strange behavior of that extra trigger when activity is resumed. </p>
  
  <p>However I need the use or rxjava for more complicated actions and threading. Any idea why is that trigger happens? </p>