Change the font of ActionBar title

Change the font of ActionBar title using SpannableString.

Just follow the code.

SpannableString s = new SpannableString("It's a new font");
s.setSpan(new TypefaceSpan(this, "arial.ttf"), 0, s.length(),
       Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
getActionBar().setTitle(s);

Comments

Popular posts from this blog

Clear the app data programmatically in android

convert an integer to a string in java

Print the large string values in android log cat.