Answer the question
In order to leave comments, you need to log in
When you rotate the screen, the news disappears?
I created an Android application that parses json and displays it in a TabLayout. There are 3 tabs (ViewPager, Fragment ) and parsed news in them. Only when you turn the device over does the news fall. And the fragment becomes empty.
Here is what
No adapter attached; skipping layout
How to make news not disappear?
Answer the question
In order to leave comments, you need to log in
In the
@Override snippet
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question