From fe79cc8b05637b7dd3fc8f4c37a54e5f85da1efc Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期三, 27 三月 2024 17:35:27 +0800
Subject: [PATCH] 优化卡标识设置界面提示

---
 app/src/main/java/com/dayu/recharge/tools/NfcReadHelper.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/com/dayu/recharge/tools/NfcReadHelper.java b/app/src/main/java/com/dayu/recharge/tools/NfcReadHelper.java
index 650415d..412adeb 100644
--- a/app/src/main/java/com/dayu/recharge/tools/NfcReadHelper.java
+++ b/app/src/main/java/com/dayu/recharge/tools/NfcReadHelper.java
@@ -1,5 +1,6 @@
 package com.dayu.recharge.tools;
 
+import android.app.Activity;
 import android.content.Intent;
 import android.nfc.NfcAdapter;
 import android.nfc.Tag;
@@ -11,7 +12,6 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -29,7 +29,8 @@
     private static NfcReadHelper helper;
 
 
-    public NfcReadHelper(Intent intent) {
+    public NfcReadHelper(Intent intent, Activity activity) {
+        super(activity);
         this.tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
 
     }
@@ -40,9 +41,9 @@
      * @param intent
      * @return
      */
-    public static NfcReadHelper getInstence(Intent intent) {
+    public static NfcReadHelper getInstence(Intent intent, Activity activity) {
         if (helper == null) {
-            helper = new NfcReadHelper(intent);
+            helper = new NfcReadHelper(intent, activity);
         }
         return helper;
     }
@@ -132,7 +133,7 @@
 
                 } else {
                     Log.i("NFCWreatActivity", "isOpen===" + isOpen);
-                    return "-1";
+                    return "-2";
                 }
             } catch (IOException e) {
                 return "-1";

--
Gitblit v1.8.0