NFC broadcastreceiver problem
问题 I want my app to listen to nfc tags only when is activated. For this I tried to register an nfc listener as following, without any success. IntentFilter filter = new IntentFilter("android.nfc.action.TECH_DISCOVERED"); registerReceiver(nfcTagListener, filter); BroadcastReceiver nfcTagListener = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)) { Tag tag = intent