Here is my code and screenshot I'm trying to set custom font typeface but Runtime exception occurs font asset not found while font file is in asset folder. Am I missing something ?
Typeface font = Typeface.createFromAsset(getAssets(), "font/terminal.ttf");
((TextView) findViewById(R.id.weatherHeadingTV)).setTypeface(font);
Use this method :
final Typeface typeface = ResourcesCompat.getFont(context, R.font.X);
ResourcesCompat
class is a compatible way to retrieve your resources.