title: How to transform the context of fragment into a LifecycleOwner?
body: <p>I have the following scenario. I have an activity which holds a fragment. In this fragment I'm displaying some records from a back-end database. I'm also using an adapter that looks like this:</p>
  
  <pre><code>public class MovieAdapter extends PagedListAdapter&lt;Movie, MovieAdapter.MovieViewHolder&gt; {
      private Context context;
  
      public MovieAdapter(Context context) {this.context = context;}
  
      @NonNull
      @Override
      public MovieViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
          //Create the view
      }
  
      @Override
      public void onBindViewHolder(@NonNull final MovieViewHolder holder, int position) {
          Movie movie = getItem(position);
          String title = movie.title;
          holder.titleTextView.setText(title);
  
          MovieRepository movieRepository = new MovieRepository(context);
          LiveData&lt;Movie&gt; liveData = movieRepository.retrieveFavoriteMovie(movie.id);
          liveData.observe(context, m -&gt; { //Error
              if(m != null) {
                  boolean favorite = m.favorite;
                  if(favorite) {
                      //Do something
                  } else {
                      //Do something else
                  }
              }
          });
      }
  
      class MovieViewHolder extends RecyclerView.ViewHolder {
          ImageView favoriteImageView;
          TextView titleTextView;
  
          MovieViewHolder(View itemView) {
              super(itemView);
              titleTextView = itemView.findViewById(R.id.title_text_view);                favoriteImageView = itemView.findViewById(R.id.favorite_image_view);
          }
      }
  }
  </code></pre>
  
  <p>In the <code>onBindViewHolder</code> I'm trying to check if a specific movie exist in Romm database but I get this error:</p>
  
  <pre><code>Wrong 1st argument type. Found: 'android.content.Context', required: 'android.arch.lifecycle.LifecycleOwner'
  </code></pre>
  
  <p>So how to transform the context of fragment into a <code>LifecycleOwner</code> so I can use it as in argument in my method?</p>