Reputation: 53600
In main page of my program I have some buttons such as Help. When user clicks it an activity appears and shows some guideline. It is full text and I need to change color of some words as I like. for bold and italic I don't have problem, easily I surround my words with . But I don't know what should I do to change color of some words.
Please tell me what should I do?
Upvotes: 1
Views: 565
Reputation: 128428
I thought that you want to provide About us/Help file inside your android application, then you can perform as the following:
webview.loadUrl("file:///android_asset/about_applicatio.html");
This way you can create a HTML file and thereby you can apply the color/javascript/bold/italic that you want inside the HTML file.
Upvotes: 1
Reputation: 38420
Use Html.fromHtml
to create a Spanned
text and assign it to the TextView.
http://developer.android.com/reference/android/text/Html.html
Upvotes: 1
Reputation: 1651
How about using a WebView instead of a TextView, then you can just update the HTML. It is definitely uses more resources, but may do what you need.
Upvotes: 1