compulsory asterisk in textview android -
i using fields mandatory , using textview
includesred colored asterisk
my output: click link!
required output : click link!
i tried modify code,but didn't got expected result
public void setcompulsoryasterisk(){ txt_name="name : "; string colored="*"; spannablestringbuilder strbuilder=new spannablestringbuilder(); strbuilder.append(txt_name); int start=strbuilder.length(); strbuilder.append(colored); int end=strbuilder.length(); strbuilder.setspan(new foregroundcolorspan(color.red), start, end, spannable.span_exclusive_exclusive); txtname.settext(strbuilder); }
string txt_name="name "; string colored="*"; string colon = " : ";
after append string colored, append string colon
after it. voila.
Comments
Post a Comment