At the end of page 264, when I tried to run CriminalIntent it crashed.
logcat says I’m getting a NullPointerException at line 69 of CrimeListFragment.java
69:
if (mSubtitleVisible) {
subtitleItem.setTitle(R.string.hide_subtitle);
} else {
subtitleItem.setTitle(R.string.show_subtitle);
}
So mSubtitleVisible is null.
To resolve this, I added a conditional initialization in the onCreateView method after the mCrimeRecyclerView is set:
if (mSubtitleVisible == null){
mSubtitleVisible = false;
}
Not sure if this is the approach we’d need to take or how else we should be initializing this.