title: Why cant I observe data with viewmodel as LifecycleOwner?
body: <p>I load my data using an <code>AsyncTask</code> in my <code>ViewModel</code> but when i try to observe the data inside my fragment then i get the exception:<br>
  <strong>Caused by: java.lang.ClassCastException: MainFragment cannot be cast to android.arch.lifecycle.LifecycleOwner</strong></p>
  
  <p><strong>This is my ViewModel:</strong></p>
  
  <pre><code>private MutableLiveData&lt;ArrayList&lt;Song&gt;&gt; songs;
  public LiveData&lt;ArrayList&lt;Song&gt;&gt; getSongs() {
      if (songs == null) {
          songs = new MutableLiveData&lt;ArrayList&lt;Song&gt;&gt;();
          loadSongs();
      }
      return songs;
  }
  
  @SuppressLint("StaticFieldLeak")
  private void loadSongs() {
  
      new AsyncTask&lt;Void, Void, ArrayList&lt;Song&gt;&gt;() {
          @Override
          protected ArrayList&lt;Song&gt; doInBackground(Void... voids) {
              ArrayList&lt;Song&gt; data = new ArrayList&lt;&gt;();
  
              //Add songs (collapsed)
  
              return data;
          }
  
          @Override
          protected void onPostExecute(ArrayList&lt;Song&gt; data) {
              songs.postValue(data);
          }
      }.execute();
  }
  </code></pre>
  
  <p><strong>And this is my fragment where i want my data inside my listview:</strong></p>
  
  <pre><code>viewModel = ViewModelProviders.of(getActivity()).get(SharedViewModel.class);
  
      //TODO: Fix this!
      viewModel.getSongs().observe((LifecycleOwner) this, new Observer&lt;ArrayList&lt;Song&gt;&gt;() {
          @Override
          public void onChanged(@Nullable ArrayList&lt;Song&gt; songs) {
              adapter = new ListViewAdapter(R.layout.songlist_customlayout, viewModel.getSongs().getValue(), getActivity());
          }
      });
  </code></pre>
  
  <p>What is the problem here?</p>