Android TextView: text not shown if setText from HTML and android:singleLine="true" -


i'm setting text textview calling

tv.settext(html.fromhtml("<a href=\"" + link + "\">" + text + "</a>"));

this text web link.

this working fine till cut text myself. i've set:

android:singleline="true" android:ellipsize="end" 

to textview, text not visible anymore.

is known issue or ?

edit:

to let others better understand problem, explain in details happening:

this textview:

    <textview         android:id="@+id/txteventrecipient"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:enabled="true"         android:focusable="false"         android:gravity="center"         android:linksclickable="true"         android:padding="5dp"         android:textcolor="@drawable/elv_title_1_selector"         android:textsize="@dimen/small_text_size"         android:textstyle="bold"         android:typeface="normal" /> 

this code set text link:

textview tv = (textview) convertview.findviewbyid(r.id.txteventrecipient);  string username = "<a user name got somewhere>";  // here cutting username it's length must fit  if (username.length() > 16)     username = username.substring(0, 15) + "…";  // here set link user tv.settext(html.fromhtml("<a href=\"" + link + "\">" + username + "</a>")); tv.setmovementmethod(linkmovementmethod.getinstance()); 

this working horrible fixed 16 max length decided make more dynamic "singleline".

the singleline="true" causing problem not showing text html link.

android:singleline has been more-or-less deprecated while. infrequently works. android:maxlines="1" more typical nowadays.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -