Note that there are some explanatory texts on larger screens.

plurals
  1. POlistview item with button not responding to onListItemClick
    primarykey
    data
    text
    <p>I am working on an app where the list item are complex, TextView and two ImageButtons. I have looked at the around for a solution, and tried all that I have seen, still nothing.</p> <p>The list is part of the ListFragment on I have Override onListItemClick.</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFF" &gt; &lt;TextView android:id="@+id/medcine_info_txt" android:layout_width="fill_parent" android:layout_height="200dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:clickable="false" android:focusable="false" android:focusableInTouchMode="false" android:padding="3dp" android:textColor="@color/black" /&gt; &lt;ImageButton android:id="@+id/item_edit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/medcine_info_txt" android:layout_alignParentLeft="true" android:contentDescription="@string/item_edit" android:focusable="false" android:focusableInTouchMode="false" android:src="@android:drawable/ic_menu_edit" /&gt; &lt;ImageButton android:id="@+id/item_history" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/medcine_info_txt" android:layout_centerHorizontal="true" android:contentDescription="@string/item_history" android:focusable="false" android:focusableInTouchMode="false" android:src="@android:drawable/btn_star" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>This my adapter getView where I have on handle the buttons click, and it implements OnClickListener</p> <pre><code>public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflator = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View listItem = inflator.inflate(R.layout.medcince_list_item, null); ImageButton mEdit = (ImageButton)listItem.findViewById(R.id.item_edit); mEdit.setOnClickListener(this); mEdit.setTag(getItem(position)); ImageButton mHistory = (ImageButton)listItem.findViewById(R.id.item_history); mHistory.setOnClickListener(this); mHistory.setTag(getItem(position)); return listItem; } </code></pre> <p>Any thoughts on why the onListItemClick is not handling the click?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload