Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy Can't my ListView get long clicked?
    primarykey
    data
    text
    <p>I am using a listview layout in a descendant of Activity, the Adapter's getView implementation is as follow, it's longclickable:</p> <pre><code>public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { TextView tv = new TextView(CustomTitleActivity.this); tv.setText(title[position]); return tv; } return convertView; } </code></pre> <p>but when I tried inflate the item's view from a layout file like this: </p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/local_songs_list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:focusable="false" android:orientation="horizontal"&gt; &lt;LinearLayout android:layout_weight="1" android:focusable="false" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"&gt; &lt;TextView android:id="@+id/title" android:layout_height="wrap_content" android:layout_width="fill_parent" android:focusable="false" android:text="TITLE" android:textAppearance="?android:textAppearanceSearchResultTitle" /&gt; &lt;TextView android:id="@+id/artist" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Unknow" android:focusable="false" android:textAppearance="?android:textAppearanceSearchResultSubtitle" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_weight="3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:focusable="false" android:orientation="horizontal"&gt; &lt;ImageButton android:id="@+id/favorite" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_favourite" android:background="#0000" android:focusable="false" android:onClick="onToggleStar"/&gt; &lt;CheckBox android:id="@+id/select" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="visible" android:focusable="false"/&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>I could not click/long click them, I already tried to set android:focusable attribute to false. Could someone give me a hint?</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.
 

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