I connected a custom font to the MainActivity

Typeface typeface = Typeface.createFromAsset(getAssets(), "BeeskneesC.otf"); 

How can I change the ActionBar font style to custom?

    1 answer 1

    You can either in this way

     int titleId = getResources().getIdentifier("action_bar_title", "id", "android"); TextView textView = (TextView) findViewById(titleId); textView.setTextColor(getResources().getColor(R.color.black)); textView.setTypeface(face); 

    either in this way

     SpannableString s = new SpannableString("My Title"); s.setSpan(new TypefaceSpan(this, "MyTypeface.otf"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(s);