Android RecyclerView Clicks
<p>I am trying to achieve the functionality seen on Google Play where a CardView has an options menu that can be clicked and you can click on the card to view more detail on the card.</p>

<p>I have implemented an OnItemTouch listener on my RecyclerView which works fine and responds when touched, taking me to another activity.  However, when I now try and add a click listener to an options icon I have added within the RecyclerView item (which is a CardView), the OnItemTouch listener is called.  Can anyone help?</p>

<p>Activity </p>

<pre><code>mRecyclerView.addOnItemTouchListener(
            new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() {
                @Override
                public void onItemClick(View view, int position) {
                    Intent intent = new Intent(getApplicationContext(),
                            TransactionDetailActivity.class);
                    Bundle bundle = new Bundle();
                    bundle.putSerializable("transaction_key", mTransactionList.get(position));
                    intent.putExtras(bundle);
                    startActivity(intent);
                }
            })
    );        mRecyclerView.setAdapter(mAdapter);
</code></pre>

<p>Click Listener</p>

<pre><code>public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {
    private OnItemClickListener mListener;

    public interface OnItemClickListener {
        public void onItemClick(View view, int position);
    }

    GestureDetector mGestureDetector;

    public RecyclerItemClickListener(Context context, OnItemClickListener listener) {
    mListener = listener;
    mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
        @Override
        public boolean onSingleTapUp(MotionEvent e) {
            return true;
            }
        });
    }

    @Override
    public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e)    {
        View childView = view.findChildViewUnder(e.getX(), e.getY());
        if (childView != null &amp;&amp; mListener != null &amp;&amp; mGestureDetector.onTouchEvent(e)) {
            mListener.onItemClick(childView, view.getChildPosition(childView));
            return true;
        }
        return false;
    }

    @Override
    public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) {
    }

    @Override
    public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
    }
}
</code></pre>