I want to add a TypeFace
to my TextView
. here's my Java code
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView helptitle = (TextView)findViewById(R.id.title_help);
Typeface typeface = Typeface.createFromAsset(getAssets(), "beyond_the_mountains.ttf");
helptitle.setTypeface(typeface);
setContentView(R.layout.activity_help);
}
but when i run the app, i get a log cat error
Caused by: java.lang.NullPointerException
at com.example.enxin.crystallise.Help.onCreate(Help.java:15)
There are many kinds of NullPointerException so I'm not sure how to solve this