[Android Pro] Android Fragment getActivity返回null解决
overide FragmentActivity onSaveInstanceState method like this.
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if(outState != null) { String FRAGMENTS_TAG = "android:support:fragments"; // remove掉保存的Fragment outState.remove(FRAGMENTS_TAG); } }