Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make HTML links in a listView Item focusable?
    primarykey
    data
    text
    <p>I wanna make an app which is quite similar to the official twitter client for android.</p> <p>In my listView Item ,there is a TextView which has some html content,I hope the links within it can be focusable and clickable,I have used:</p> <pre><code>getListView().setItemsCanFocus(true); </code></pre> <p>but it still doesn't work,I don't know why.</p> <p>the layout is like this:</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/item" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="6dip" android:background="#FFFFFF"&gt; &lt;ImageView android:id="@+id/avatar" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:src="@drawable/default_happy_face" /&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;RelativeLayout android:id="@+id/linearBanner" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="20dip"&gt; &lt;TextView android:id="@+id/txtNickname" android:layout_width="wrap_content" android:textColor="#1C86EE" android:text="mmLiu" android:layout_height="fill_parent"/&gt; &lt;ImageView android:id="@+id/verified" android:layout_width="24dip" android:layout_height="24dip" android:paddingLeft="4dip" android:layout_toRightOf="@id/txtNickname" android:background="@drawable/verified"/&gt; &lt;TextView android:id="@+id/txtTime" android:textColor="#999999" android:layout_height="fill_parent" android:layout_alignTop="@+id/txtNickname" android:layout_alignRight="@layout/notice_item" android:layout_toRightOf="@+id/verified" android:layout_width="fill_parent" android:gravity="right" android:text="半个小时前"/&gt; &lt;/RelativeLayout&gt; &lt;TextView android:id="@+id/txtContent" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#050505" android:text="!时尚起义 波点连衣裙原价116,现价69素雅波点拼接长裙,素色上装搭配雪纺波点短裙,优雅恬静,非你莫属!【商家地址:http://1net.cn/8wf】#服饰#" android:clickable="true"/&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>I hope the links can be focused instead of the whole item,this issue have been discussed in the google io,see <a href="http://code.google.com/events/io/2010/sessions/world-of-listview-android.html" rel="nofollow noreferrer">here</a> and the solution is getListView().setItemsCanFocus(true); But it just doesn't work for me.</p> <p>I used an comstimized adapter which extends the BaseAdapter,I don't know if that has sth to do with it.</p> <p>anyone? any help ?</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