I have a custom font for my android activity.
MainActivity.class
private void initControls() {
// TODO Auto-generated method
Here is the custom adapter class and the constructor
class CustomAdapter extends ArrayAdapter<CharSequence>{
Context context;
int layoutResourceId;
CharSequence data[] = null;
Typeface tf;
public CustomAdapter(Context context, int layoutResourceId, CharSequence[] data, String FONT ) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.context = context;
this.data = data;
tf = Typeface.createFromAsset(context.getAssets(), FONT);
}
Put the font you want to use in your assets folder and fill your listview like this:
listAdapter = new CustomAdapter(this, R.layout.custom_list_text, R.array.abra_hotel, "name_of_font.ttf");
you can't apply font directly to listview and you need to create custom adapter for listview and change it font for more details click below stack post it's already discussed.
How to change color and font on ListView