Samsung Galaxy Tab 3 7.0 Android 4.4.4: TextView Html.fromHtml does not work -


i have code show green feedback stars in textview:

spanned sp = html.fromhtml("<font color=\"#00dd00\">★</font>"); tv.settext(sp); 

and works on devices i've tested beside 1 in topic.

i cannot understand why.

a big problem device not mine , don't know when can test again, cannot reproduce bug.

another problem i've tested couple of emulators android 4.4.4 , not find problem.

is there way show colored text in safer way ? of course stars 5 , can colored in dynamic way (gray or green) otherwise not problem.

to more detailed: if there 2 green stars, code is

spanned sp = html.fromhtml("<font color=\"#00dd00\">★</font><font color=\"#00dd00\">★</font>"); tv.settext(sp); 

because it's created in loop <font color=\"#00dd00\">★</font> constant.

edit:

this definition of textview

<textview     android:id="@+id/txtthumbnail"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_marginleft="20dp"     android:layout_marginright="40dp"     android:ellipsize="end"     android:gravity="center_vertical"     android:maxlines="1"     android:text=""     android:textsize="@dimen/elv_group_thumbnail_text_size"/> 

"it not work" means stars shown not green seems html color tag has no effect.

the solution, suggested @commonsware, replace textview ratingbar

i had create own star pictures , selector handle them but, @ end, simpler. proof had delete code :)

i don't know if works on samsung device don't think samsung has fiddled ratingbar. device, test , post result but, far, acceptable solution side.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -