title: ListView long click not working when a button is in list
body: <p>I have a ListView with custom list adapter. It has OnItemClickListener and OnItemLongClickListner which used to work fine. After then, I had to put a button in the layout of list item and the item click and long click listener stopped working. Here is my sample code:</p>
  
  <pre><code>ListView lv=(ListView)findViewbyId(R.id.listview); 
  lv.setAdapter(listviewadapter);
  lv.setOnItemLongClickListener(new OnItemLongClickListener() {
              @Override
              public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {
              // My code
              }
  });
  </code></pre>
  
  <p>This used to work fine before adding the button in the layout of list item:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" 
      android:padding="2dp"
      &gt;
      &lt;TextView
          android:id="@+id/symbol_name"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="2.5"
          android:layout_gravity="left"
          /&gt;
      &lt;TextView
          android:id="@+id/ltp"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:layout_weight="1"
          /&gt;
      &lt;TextView
          android:id="@+id/change_in_perc"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:layout_weight="1"
          /&gt;
  
      &lt;TextView
          android:id="@+id/volume"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:layout_weight="1"
          /&gt;
  
      &lt;ImageButton
          android:id="@+id/chart"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_gravity="right"
          android:layout_weight="0.5"
          android:src="@drawable/charts"
          android:contentDescription="Chart Link"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I tried changing inline listener to implementing onItemLongClickListener on activity but no success till now. Thanks.</p>