android
String questionText=“Hello good evenin${b}${u} Amit is the best ${/u}${/b} and he loves singing”; [closed]
How to get the underline & bold text from that string.. I need output like Hello good evening "underline&bold" and he loves singing.
Use this for bold and underline String tempString="yourString"; SpannableString spanString = new SpannableString(tempString); spanString.setSpan(new UnderlineSpan(), 0, spanString.length(), 0); spanString.setSpan(new StyleSpan(Typeface.BOLD), 0, spanString.length(), 0);
It is simple as you like. Message = "<HTML><BODY><U><B>TEST STRING</BODY></HTML>"; //or Message = "<U><B>TEST STRING</B></U>"; Textview.setText(Html.fromHtml(Message)); you just need to add html formatted string to textview so it will render as per html format.
Use textview.setText(Html.toHtml(myString)); where you can use html tags to make bold and underlined in the myString variable. say myString="My name is <b> Naresh</b>...";
Related Links
TabLayout ViewPager Icon Show at Corners in Android
android How to get values from thread to mainUI
Can we uninstall application without user's consent
Webview error API 19 below
Android: saving and reading data from user's input?
convert android xml drawable to sgv (reverse android studio function)
Facebook Integration in Android Studio [closed]
Realm for android data file size on API 21 is higher than Api 17
Calculate the total travelled distance Google Maps API V3 in Android
Android - Extrac SameSite=Strict cookie from Webview or URL
Android Studio: CoordinatorLayout could not be initiated
could not found method crashlystic() in.fabric
How to give run time permission for marshmallow for read SMS from inbox in eclipse
Calling Android native method fail
How to use LatLngBounds?
how to save edittext value in a listview to android sqlite?