I have one Activity
that get ActionBar
title from ListView
position in other activity and I want set Typeface
in ActionBar
.
package com.cambobox.actionbartitle.actionbar;
import android.app.ActionBar;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.TypefaceSpan;
import android.widget.TextView;
public class Song extends ActionBarActivity {
Typeface font;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_song);
font = Typeface.createFromAsset(getAssets(),"fonts/khmerbibleregular.ttf");
Intent intent = getIntent();
String listview_id = intent.getStringExtra(SongList.NAME);
ActionBar actionnbar_title = getActionBar();
actionnbar_title.setDisplayShowTitleEnabled(true);
actionnbar_title.setTitle(font);
actionnbar_title.setTitle(listview_id);
}
}