How to set the font of a TextView created at runtime?
I created a TextView
Textview tv = new TextView(this);
tv.setTextSize(20);
You need to use Typeface:
create Typeface object using that font:
Typeface myFont = Typeface.createFromAsset(getAssets(), "fonts/MyFont.ttf");
set typeface to the object you'd like to customize:
TextView myTextView = (TextView)findViewById(R.id.my_text_view);
myTextView.setTypeface(myFont);