Skip to content

Commit 2ec8393

Browse files
author
Martijn Coenen
committed
Remove NfcFragment from activity when no longer sharing.
This fixes scenarios where the same activity sets, unsets and re-sets an NdefMessage and/or callback. Bug: 5454848 Change-Id: I5ed98047b9cfe90d2f48656d978f2d08bb4bf0cc
1 parent 9ad680c commit 2ec8393

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/java/android/nfc/NfcActivityManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ synchronized NfcActivityState getOrCreateState(Activity activity, boolean create
162162
synchronized void maybeRemoveState(Activity activity, NfcActivityState state) {
163163
if (state.ndefMessage == null && state.ndefMessageCallback == null &&
164164
state.onNdefPushCompleteCallback == null) {
165+
NfcFragment.remove(activity);
165166
mNfcState.remove(activity);
166167
}
167168
}

0 commit comments

Comments
 (0)