Unable to add custom font in RecyclerView.ViewHolder
问题 I am working on an android project and I added custom fonts on few layouts successfully. But when I tried adding them in a class which is not an activity which extends RecyclerView.ViewHolder, it creates a null pointer exception. I tried looking for but no luck. Initially I did not use context.getAssets(), I only used getAssets(). But then I was getting "cannot resolve method" on getAssets(). Since getAssets() is a part of Context, I included context and then all the errors went away. But