I want to style my content with some bold text and even linked text. I Googled as usual for the answer to do this possible and I found this website: . The funny thing here is that none of those examples works for me!
Here’s my the code in About.java:
public class About extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
SpannableString ss = new SpannableString("\"Vädret just nu\" är en webbaserad");
ss.setSpan(new StyleSpan(Typeface.BOLD), 2, 14, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
TextView t4 = (TextView) findViewById(R.id.about_app);
t4.setText(ss);
t4.setMovementMethod(LinkMovementMethod.getInstance());
}
}
Vädret just nu should be bold with that code, right? It isn’t! I’m quite frustrated right now but I’m also new in this area. How can I fix my small problem?
I make it work now! Here’s the solution: