Is it possible to set multiple styles for different pieces of text inside a TextView?
For instance, I am setting the text as follows:
tv.setText(line
Slightly off-topic, but I found this too useful not to be mentioned here.
What if we would like to read the the Html text from string.xml resource and thus make it easy to localize. CDATA make this possible:
Autor: Mr Nice Guy
Contact: myemail@grail.com
Copyright © 2011-2012 Intergalactic Spacebar Confederation
]]>
From our Java code we could now utilize it like this:
TextView tv = (TextView) findViewById(R.id.myTextView);
tv.setText(Html.fromHtml(getString(R.string.my_text)));
I did not expect this to work. But it did.
Hope it's useful to some of you!