Advertisement
ubersoldat

SpannableString onCreate

Aug 26th, 2013
6,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. @Override
  2. protected void onCreate(Bundle savedInstanceState) {
  3.     super.onCreate(savedInstanceState);
  4.    
  5.     SpannableString s = new SpannableString(iconMedic + " Activity");
  6.     s.setSpan(
  7.         new TypefaceSpan(this, FONT_AWESOME, 40, lightBlue),
  8.         0,
  9.         1,
  10.                 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
  11.         );
  12.  
  13.     // Update the action bar title with the TypefaceSpan instance
  14.     ActionBar actionBar = getActionBar();
  15.     actionBar.setTitle(s);
  16.     actionBar.setIcon(android.R.color.transparent); // hide the app's icon
  17.    
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement