I'm trying to save data in a Fragment's onSaveInstanceState(), but the method is never called.
Can someone help?
public class MyFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ScrollView content = (ScrollView) inflater.inflate(R.layout.content, container, false);
// More stuff
return content;
}
@Override
public void onSaveInstanceState(Bundle icicle) {
// NEVER CALLED
super.onSaveInstanceState(icicle);
//More stuff
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…