We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aeb11b5 + deb0f20 commit 1eca250Copy full SHA for 1eca250
core/java/android/nfc/NfcFragment.java
@@ -48,7 +48,10 @@ public static void remove(Activity activity) {
48
FragmentManager manager = activity.getFragmentManager();
49
Fragment fragment = manager.findFragmentByTag(FRAGMENT_TAG);
50
if (fragment != null) {
51
- manager.beginTransaction().remove(fragment).commit();
+ // We allow state loss at this point, because the state is only
52
+ // lost when activity is being paused *AND* subsequently destroyed.
53
+ // In that case, the app will setup foreground dispatch again anyway.
54
+ manager.beginTransaction().remove(fragment).commitAllowingStateLoss();
55
}
56
57
0 commit comments