title: RecyclerView item onClickListener doesn't work on a first click, but works on a second one
body: <p>Adapter </p>
  
  <pre><code>public class MoviesAdapter extends 
  RecyclerView.Adapter&lt;MoviesAdapter.MoviesViewHolder&gt; {
  private static final String baseMovieUrl = "http://image.tmdb.org/t/p/w500";
  private ArrayList&lt;Movie&gt; movies;
  private Context context;
  
  public MoviesAdapter(ArrayList&lt;Movie&gt; movies, Context context) {
      this.movies = movies;
      this.context = context;
  }
  
  @NonNull
  @Override
  public MoviesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
      return new MoviesViewHolder(layoutInflater.inflate(R.layout.movie_square, parent, false));
  }
  
  @Override
  public void onBindViewHolder(@NonNull MoviesViewHolder holder, int position) {
      holder.setData(position);
  
  }
  
  
  @Override
  public int getItemCount() {
      return movies.size();
  }
  
  
  public class MoviesViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
      private ConstraintLayout movieConstraint;
      private TextView movieName;
      private TextView movieRate;
      private ImageView moviePoster;
  
      public MoviesViewHolder(View itemView) {
          super(itemView);
          movieConstraint = itemView.findViewById(R.id.movie_holder_constraints);
          movieName = itemView.findViewById(R.id.movie_name_tv);
          movieRate = itemView.findViewById(R.id.movie_rating_tv);
          moviePoster = itemView.findViewById(R.id.movie_iv);
          movieConstraint.setOnClickListener(this);
  
      }
  
      public void setData(int position) {
          movieConstraint.setTag(position);
          movieName.setText(movies.get(position).getMovieName());
          movieRate.setText(movies.get(position).getMovieRating() + "");
          if (!Objects.equals(movies.get(position).getMovieUrl(), "") &amp;&amp; movies.get(position).getMovieUrl() != null) {
              Glide.with(moviePoster).load
                      (baseMovieUrl + movies.get(position).getMovieUrl())
                      .into(moviePoster);
          } else Log.i("No url!", "No url!");
      }
  
      @Override
      public void onClick(View view) {
          int pos = (int) view.getTag();
          view.setEnabled(false);
          changeActivity(pos);
          view.setEnabled(true);    // TODO Find a way to prevent 2 acctivites to open simultaniously
      }
  
  
      private void changeActivity(int pos) {
          Movie movie = movies.get(pos);
          Intent intent = new Intent(context, MovieInfo.class);
          intent.putExtra("movie", movie);
          ActivityOptionsCompat options = ActivityOptionsCompat.
                  makeSceneTransitionAnimation((Activity) context, moviePoster, "profile");
          context.startActivity(intent, options.toBundle());
      }
  }
  }
  </code></pre>
  
  <p>and the xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/movie_holder_constraints"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:padding="3dp"&gt;
  
  &lt;android.support.v7.widget.CardView
      android:id="@+id/movie_cv"
      android:layout_width="185dp"
      android:layout_height="250dp"
      android:layout_marginBottom="8dp"
      android:layout_marginEnd="8dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="8dp"
      android:focusable="false"
      android:focusableInTouchMode="false"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:id="@+id/inside_movie_constraints"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:focusable="false"
          android:focusableInTouchMode="false"
          &gt;
  
          &lt;ImageView
              android:id="@+id/movie_iv"
              android:layout_width="185dp"
              android:layout_height="180dp"
              android:scaleType="fitXY"
              android:focusable="false"
              android:focusableInTouchMode="false"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent"
              app:srcCompat="@mipmap/ic_launcher" /&gt;
  
          &lt;TextView
              android:id="@+id/movie_rating_tv"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginBottom="8dp"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="16dp"
              android:layout_marginTop="2dp"
              android:text="9.5"
              android:textColor="@color/colorAccent"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintHorizontal_bias="0.0"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/movie_name_tv"
              app:layout_constraintVertical_bias="1.0" /&gt;
  
          &lt;TextView
              android:id="@+id/movie_name_tv"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="8dp"
              android:text="Guardian's Of The Galaxy"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintHorizontal_weight="1"
              android:gravity="center"
              android:includeFontPadding="false"
              app:layout_constraintTop_toBottomOf="@+id/movie_iv" /&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p></p>
  
  <p>When clicking on the item in the recyclerView it wont open the activity or call the OnClickListener, after clicking another time the function is being called.
  scrolling would also allow me to click on the items aswell.</p>
  
  <p>I have heared changing the foucsable to false might solve this problem but as you can see in the xml it didn't.</p>
  
  <p><strong><em>Edit for adapter:</em></strong>
  I changed the onClick to the onBindViewHolder, It fixed the problem although it doesn't feel to me like the right way to do it.
  what do you say?</p>
  
  <pre><code>package com.example.galzaid.movies;
  
  import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.support.annotation.NonNull;
  import android.support.constraint.ConstraintLayout;
  import android.support.v4.app.ActivityOptionsCompat;
  import android.support.v7.widget.RecyclerView;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.bumptech.glide.Glide;
  
  import java.util.ArrayList;
  import java.util.Objects;
  
  public class MoviesAdapter extends 
  RecyclerView.Adapter&lt;MoviesAdapter.MoviesViewHolder&gt; implements 
  View.OnClickListener {
  private static final String baseMovieUrl = "http://image.tmdb.org/t/p/w500";
  private ArrayList&lt;Movie&gt; movies;
  private Context context;
  
  public MoviesAdapter(ArrayList&lt;Movie&gt; movies, Context context) {
      this.movies = movies;
      this.context = context;
  }
  
  @NonNull
  @Override
  public MoviesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
      return new MoviesViewHolder(layoutInflater.inflate(R.layout.movie_square, parent, false));
  }
  
  @Override
  public void onBindViewHolder(@NonNull MoviesViewHolder holder, int position) {
      holder.setData(position);
      holder.itemView.setOnClickListener(this);
      holder.getAdapterPosition();
  }
  
  
  @Override
  public int getItemCount() {
      return movies.size();
  }
  
  @Override
  public void onClick(View view) {
      ImageView moviePoster = view.findViewById(R.id.movie_iv);
      changeActivity((int) view.getTag(), moviePoster);
  }
  
  private void changeActivity(int pos, ImageView moviePoster) {
      Movie movie = movies.get(pos);
      Intent intent = new Intent(context, MovieInfo.class);
      intent.putExtra("movie", movie);
      ActivityOptionsCompat options = ActivityOptionsCompat.
              makeSceneTransitionAnimation((Activity) context, moviePoster, "profile");
      context.startActivity(intent, options.toBundle());
  }
  
  
  public class MoviesViewHolder extends RecyclerView.ViewHolder {
      private ConstraintLayout movieConstraint;
      private TextView movieName;
      private TextView movieRate;
      private ImageView moviePoster;
  
      public MoviesViewHolder(View itemView) {
          super(itemView);
          movieConstraint = itemView.findViewById(R.id.movie_holder_constraints);
          movieName = itemView.findViewById(R.id.movie_name_tv);
          movieRate = itemView.findViewById(R.id.movie_rating_tv);
          moviePoster = itemView.findViewById(R.id.movie_iv);
  
      }
  
      public void setData(int position) {
          movieConstraint.setTag(position);
          movieName.setText(movies.get(position).getMovieName());
          movieRate.setText(movies.get(position).getMovieRating() + "");
          if (!Objects.equals(movies.get(position).getMovieUrl(), "") &amp;&amp; movies.get(position).getMovieUrl() != null) {
              Glide.with(moviePoster).load
                      (baseMovieUrl + movies.get(position).getMovieUrl())
                      .into(moviePoster);
          } else Log.i("No url!", "No url!");
      }
  }
  }
  </code></pre>