android DialogFragment savedInstanceState在onCreateView中丢失

时间:2013-10-24 11:21:30

标签: android

我有DialogFragment,我想保留一些方向更改的数据。为了做到这一点,我有类似的东西:

@Override
public void onSaveInstanceState (Bundle savedInstanceState) {
    if (savedInstanceState==null) savedInstanceState = new Bundle(); //just in case
    //here I put values to savedInstanceState

    super.onSaveInstanceState(savedInstanceState);      
}

接下来有:

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

我希望我能将已保存的数据保存在savedInstanceState中。但它总是(!)null。为什么呢?

0 个答案:

没有答案