I am trying to make a text view underlined in my Custom Dialog.
MY XML:
<TextView
android:id="@+id/tv_terms_policies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/terms_and_policies"
/>
Methods which I have tried already:
Method 1.
tvTerms=(TextView) findViewById(R.id.tv_terms_policies);
String data="TERMS AND POLICIES";
SpannableString content = new SpannableString(data);
content.setSpan(new UnderlineSpan(), 0, data.length(), 0);
tvTerms.setText(content);
Method 2.
<string name="terms_plans"><u>TERMS AND POLICIES</u></string>
Method:3
tvTerms=(TextView) findViewById(R.id.tv_terms_policies);
String htmlString="<u>TERMS AND POLICIES</u>";
tvTerms.setText(Html.fromHtml(htmlString));
unfortunatly these three methods are not working for me. Please suggest any other methods.. thnx in advnz :)