| | |
| | | package com.dayu.recharge.tools; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | | import android.nfc.NfcAdapter; |
| | | import android.nfc.Tag; |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private static NfcReadHelper helper; |
| | | |
| | | |
| | | public NfcReadHelper(Intent intent) { |
| | | public NfcReadHelper(Intent intent, Activity activity) { |
| | | super(activity); |
| | | this.tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); |
| | | |
| | | } |
| | |
| | | * @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; |
| | | } |