am 1eca250b: Merge "Fix disableForegroundNdefPush crash." into ics-mr0

* commit '1eca250b9dad45893fead128539f112cbc513496':
  Fix disableForegroundNdefPush crash.
This commit is contained in:
Martijn Coenen
2011-10-31 22:54:43 +00:00
committed by Android Git Automerger

View File

@@ -48,7 +48,10 @@ public final class NfcFragment extends Fragment {
FragmentManager manager = activity.getFragmentManager();
Fragment fragment = manager.findFragmentByTag(FRAGMENT_TAG);
if (fragment != null) {
manager.beginTransaction().remove(fragment).commit();
// We allow state loss at this point, because the state is only
// lost when activity is being paused *AND* subsequently destroyed.
// In that case, the app will setup foreground dispatch again anyway.
manager.beginTransaction().remove(fragment).commitAllowingStateLoss();
}
}