Updated on 2026-08-14

This commit is contained in:
Tangem 2018-07-18 11:35:56 +03:00
parent a79b496bb6
commit b272a54010
4 changed files with 22 additions and 22 deletions

View file

@ -79,20 +79,20 @@ public class NfcManager {
int errorCount = 0;
public void notifyReadResult(boolean success) {
if (success) {
errorCount = 0;
} else {
errorCount++;
}
if (errorCount >= 3) {
disableReaderMode();
mNfcAdapter = null;
// Toast.makeText(mActivity,"NFC restarted!",Toast.LENGTH_SHORT).show();
mActivity.runOnUiThread(() -> {
mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity);
enableReaderMode();
});
}
// if (success) {
// errorCount = 0;
// } else {
// errorCount++;
// }
// if (errorCount >= 3) {
// disableReaderMode();
// mNfcAdapter = null;
//// Toast.makeText(mActivity,"NFC restarted!",Toast.LENGTH_SHORT).show();
// mActivity.runOnUiThread(() -> {
// mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity);
// enableReaderMode();
// });
// }
}
private void showNFCEnableDialog() {