1

Android – custom fonts crash app

view story
linux-howto

http://stackoverflow.com – I'm trying to change font of a TextView to a custom one. Have read this other question and tried instructions as outlined here. The font in question is Roboto Thin, downloaded straight from Android Design and is in ttf. The code at the main activity class is as follows: TextView txt = (TextView) findViewById(R.id.hometext); Typeface font = Typeface.createFromAsset(getAssets(), "Roboto-Thin.ttf"); txt.setTypeface(font); // "hometext" is the TextView I wish to change font of. App does not crash when the above 3 lines are commented, which I hope isolates the (HowTos)