title: RecyclerView Adapter: why does onLongClick method conflict with onClick?
body: <p>In my RecyclerView's adapter file I have an OnClickListener set in the onCreateViewHolder method.  It is working correctly, which is to launch a new activity when an item in the RecyclerView list is clicked on.  I am trying to add an OnLongClickListener for a LongClick on the item that will run a different method.</p>
  
  <p>When I add the setOnLongClickListener section and onLongClick method shown below, then the items in the RecyclerView list don't show properly so something with the views must not be correct.  What am I missing here?</p>
  
  <p>Adapter file:</p>
  
  <pre><code>public class ContactListAdapter extends RecyclerView.Adapter&lt;ContactListAdapter.ContactHolder&gt;{
  
      private RecyclerItemClickListener recyclerItemClickListener;
      ...
      @Override
      public ContactHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_contact_item, parent, false);
  
      final ContactHolder contactHolder = new ContactHolder(view);
  
      contactHolder.itemView.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              int adapterPos = contactHolder.getAdapterPosition();
              if (adapterPos != RecyclerView.NO_POSITION) {
                  if (recyclerItemClickListener != null) {
                      recyclerItemClickListener.onItemClick(adapterPos, contactHolder.itemView);
                  }
              }
          }
      });
  
      contactHolder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
          @Override
          public boolean onLongClick(View view) {
              int adapterPos = contactHolder.getAdapterPosition();
              if (adapterPos != RecyclerView.NO_POSITION) {
                  if (recyclerItemClickListener != null) {
                      recyclerItemClickListener.onItemLongClick(adapterPos, contactHolder.itemView);
                  }
              }
              return false;
          }
      });
  
      return contactHolder;
  }
  
  public void setOnItemClickListener(RecyclerItemClickListener recyclerItemClickListener) {
      this.recyclerItemClickListener = recyclerItemClickListener;
  }
  </code></pre>
  
  <p>Listener file:</p>
  
  <pre><code>public interface RecyclerItemClickListener {
      void onItemClick(int position, View view);
      void onItemLongClick(int position, View v);
  }
  </code></pre>
  
  <p>Activity file:</p>
  
  <pre><code>...
  @Override
  public void onItemClick(int position, View view) {
      ActActivity.start(this, contactListAdapter.getItem(position));
  }
  
  @Override
  public void onItemLongClick(int position, View v) {
      Toast toast = Toast.makeText(this, "Test", Toast.LENGTH_LONG);
      toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
      toast.show();
  }
  </code></pre>