am 3c40675f: Merge "Fix potential NPE when saving fragment state."

* commit '3c40675f6f473896b93ca6416d29192d88e92622':
  Fix potential NPE when saving fragment state.
This commit is contained in:
Dianne Hackborn
2012-04-23 21:44:43 -07:00
committed by Android Git Automerger

View File

@@ -1538,6 +1538,9 @@ final class FragmentManagerImpl extends FragmentManager {
FragmentManagerImpl.VIEW_STATE_TAG, f.mSavedViewState);
}
if (!f.mUserVisibleHint) {
if (result == null) {
result = new Bundle();
}
// Only add this if it's not the default value
result.putBoolean(FragmentManagerImpl.USER_VISIBLE_HINT_TAG, f.mUserVisibleHint);
}