0
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 
root = inflater.inflate(R.layout.frag_alert_center, container, false);

if (savedInstanceState != null) {
            mItems = (ArrayList<AlertItemI>) savedInstanceState.getSerializable("itemBundle");
        }


//Everything else here
}

在底部我有

@Override
    public void onSaveInstanceState(Bundle outState) {
       super.onSaveInstanceState(outState);
       outState.putSerializable("itembundle", mItems);
    }

我这样做对吗?当我调试时,它永远不会回到 onCreateView() 它应该。

4

0 回答 0