In a project for Udacity, my app crashed upon reaching this line in my ui / ArticleDetailFragment class
The app just crashes in portrait mode, a null pointer exception jumps. As you can see the reviewer leaves me a hint but I do not know how to solve the problem.
Edit1: (More hints)
Currently, the app crashes with the following error on my end when I enter the Detail screen:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTypeface(android.graphics.Typeface)' on a null object reference
at com.example.xyzreader.ui.ArticleDetailFragment.bindViews(ArticleDetailFragment.java:133)
It looks like there's a view which is only available in landscape (articleTitleLand), so if you reference it in, it will be null since it will not be there.
You should fix this issue so that the app avoids crashing in any orientation.
My source code: link
RESULT: The problem was that I was asking for a font that had not yet been added to the project