版权说明:本文参考列表
1) 问题1:http://blog.csdn.net/lilu_leo/article/details/7753421
问题列举:
1. FragmentManagerImpl.saveFragmentBasicState
这个问题经常发生在Fragment跳转至另外一个FragmentActivity的时候,例如以下一段代码:
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // 实例化控件 Button btn_index_test = (Button) getActivity().findViewById(R.id.btn_index_test); btn_index_test.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent1 = new Intent(getActivity(), LocationSelectActivity.class); startActivity(intent1); } }); }
系统报错的LOG如图:
如何解决此问题呢?问题出在Save上,在含有该Fragment的Activity(注意不是要跳转到的Activity)中重写onSaveInstanceState()方法,并且注释掉super.onSaveInstanceState(),
这样就不会调用父类的onSaveInstanceState(outState)方法了,就不会报异常了。
@Override protected void onSaveInstanceState(Bundle outState) { // TODO Auto-generated method stub //super.onSaveInstanceState(outState); }
2.