For whole application u need to make custome TextView u can us as shown below for each and every textview of xml before going to this first make folder with naming fonts in asset in that fonts folder add ur font stheiti.ttf
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
public class MyTextView extends TextView{
public MyTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public MyTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyTextView(Context context) {
super(context);
init();
}
private void init() {
if (!isInEditMode()) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/stheiti.ttf");
setTypeface(tf);
}
}
}
after that for each and every textview in xml on which u want this type of font than ur textview in xml should be like this add other property of textview which u needed same as for normal textview
<YourProjectPackageName.MyTextView
android:id="@+id/textview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22px"
android:textColor="#34A4c5"
></YourProjectPackageName>
and in your activity use as shown below for custome textview
MyTextView textview=(MyTextView)findViewById(R.id.textview);