Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking list item unselectable
    text
    copied!<p>I have a list view with my custom content. I have on message iamgeview, one call and other option. So that user can select any one of the option, but if user select any text(touch the textview) or any other portion of ListView, it should not respond. I have small UI.</p> <p>So if user touches on MyText, nothing should be done. Not even Visual feed back what we get when we touch list tiem normally in android. But touch event for call, or message should come. </p> <p>My code snippet</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listitem_contact" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:padding="10dp"&gt; &lt;TextView android:id="@+id/tv_contact" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clickable="false" android:gravity="left|center_vertical"/&gt; &lt;ImageView android:id="@+id/iv_call" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="@drawable/list_item_image_color" android:src="@drawable/ic_call"/&gt; &lt;ImageView android:id="@+id/iv_message" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="@drawable/list_item_image_color" android:src="@drawable/ic_textmessage"/&gt; &lt;ImageView android:id="@+id/ic_phone" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="@drawable/list_item_image_color" android:src="@drawable/ic_phone"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>PS: On touching the portion of textview, by default first ImageView is getting selected. I don't want that any wodget should respond unless touched</p>
 

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