You are calling setContentView(R.layout.activity_puzzle);
in onResume()
, but the tvPuzContent
variable is instantiated in onCreate()
, so it refers to the text view from the original call to setContentView
in onCreate
.
Basically, by the end of onCreate
you have assigned all your variables, but then onResume
is called by the system and you call setContentView
again, which throws away your original layout, so all your variables are pointing at old views that are not on screen.
Just don't call setContentView
in onResume()
, since you aren't changing the layout anyway.