title: Android ViewModel inside Service (Alternative)
body: <p>I have a service which provides UI that is visible to user most of the time.</p>
  
  <p>I was experimenting with new Application Architecture when I came with a problem. </p>
  
  <p><code>MyModelviewModel viewModel = ViewModelProviders.of(this).get(MyModelviewModel.class);</code></p>
  
  <p>But as you know <code>this</code> can be only <code>AppCompat</code> or <code>Fragment</code></p>
  
  <p>Is there some alternative? or can I put observer directly on my <code>LiveData</code> like Im puting on <code>ViewModel</code></p>
  
  <pre><code>viewModel.getList().observe(Playground.this, new Observer&lt;List&lt;TestEntity&gt;&gt;() {
      @Override
      public void onChanged(@Nullable List&lt;TestEntity&gt; items) {
          recyclerViewAdapter.addItems(items);
      }
  });
  </code></pre>