Initializing a font
suggest changeprivate Typeface myFont; // A good practice might be to call this in onCreate() of a custom // Application class and pass 'this' as Context. Your font will be ready to use // as long as your app lives public void initFont(Context context) { myFont = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Light.ttf"); }
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents