title: Android: how to set up CardView OnLongClick()?
body: <p>I have a RecyclerView list of CardViews.  I click on a CardView and it uses an intent to launch a new activity, which shows a detail CardView to the user.  I want to add a LongClick to that new CardView that will launch a Dialog to ask the user if they would like to delete the CardView.  I tried the set up below.  The Dialog does not launch and I don't see the Toast.  What am I missing here?</p>
  
  <pre><code>public class CardViewDetails extends AppCompatActivity {
  
      int position;
      CardView cardView;
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_details);
  
      CardView cardView = (CardView) findViewById(detsinglecard_view);
      cardView.setOnClickListener((View.OnClickListener) this);
      cardView.setOnLongClickListener(new View.OnLongClickListener() {
          @Override
          public boolean onLongClick(View v) {
              Toast.makeText(CardViewDetails.this,"Dialog Test",Toast.LENGTH_SHORT).show();                
              android.app.FragmentManager fm = getFragmentManager();
              DeleteCardViewFragment delCardViewDialog = new DeleteCardViewFragment();
              delCardViewDialog.show(fm,"delcardview dialog");
              return true;
          }
      }); 
  </code></pre>
  
  <p>activity_details:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#FFFFFF"
  tools:context="com.wimso.v060B.CardViewDetails"&gt;
  
  &lt;include
      android:id="@+id/toolbar"
      layout="@layout/toolbar" &gt;
  &lt;/include&gt;
  
  &lt;RelativeLayout
      android:id="@+id/cardViewDetails"
      android:layout_width="match_parent"
      android:layout_height="match_parent"        
      android:background="@color/background4main"
      android:layout_marginTop="6dp"
      android:layout_marginStart="6dp"
      android:layout_marginLeft="6dp"
      android:layout_marginEnd="6dp"
      android:layout_marginRight="6dp"  &gt;
  
  &lt;TextView        
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="6dp"
      android:layout_marginBottom="2dp"        
      android:textStyle="bold"
      android:textColor="@color/colorFlLabelFinal"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:clickable="false"
      android:layout_centerHorizontal="true"  /&gt;
  
  &lt;Spinner
      android:id="@+id/skycard_filter2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"        
      style="@style/Base.Widget.AppCompat.Spinner"  /&gt;
  
  **strong text**&lt;android.support.v7.widget.CardView**strong text**
  
  xmlns:card_view="http://schemas.android.com/apk/res-auto"
  xmlns:android="http://schemas.android.com/apk/res/android"
  **strong text**android:id="@+id/detsinglecard_view"**strong text**
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_marginTop="2dp"
  android:layout_marginBottom="2dp"
  card_view:cardBackgroundColor="@android:color/white"
  card_view:cardCornerRadius="6dp"
  card_view:cardElevation="4dp"
  android:longClickable="true"  &gt;    
  ...
  </code></pre>