Answer the question
In order to leave comments, you need to log in
How to avoid NullPointerException on orientation change in application with FragmentTabHost?
I have an application that I developed for a long time and initially turned off the orientation change - left only portrait.
Over time, the application has grown and now, when I want to make it work in both portrait and landscape orientations, a java.lang.NullPointerException
error pops up. located on this layout.
I must say that this is one of the 4 layouts that are in FragmentTabHost.
And when defining the button, there is no error.
helpBtn = (Button) rootView.findViewById(R.id.helpBtn);
helpBtn.setVisibility(View.GONE);
android:configChanges="orientation|keyboardHidden|screenSize"
helpBtn.setVisibility(View.GONE);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question