Merge "Fix potential NPE when saving fragment state."

This commit is contained in:
Dianne Hackborn
2012-04-23 19:00:47 -07:00
committed by android code review

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);
}