Skip to content Skip to sidebar Skip to footer

Nullpointerexception When Loading Typeface From Assets In Android Studio

I would like to use a custom typeface in my Android app. I followed instructions and created an assets folder in Android studio in which I put verdana.ttf, as shown on the picture:

Solution 1:

You are trying to call createFromAsset() from an initializer. Please move this to onCreate(), after the super.onCreate() call. Methods you inherit in your Activity may not work before that point.


Post a Comment for "Nullpointerexception When Loading Typeface From Assets In Android Studio"