is Nfc Intent - Android Network

Android examples for Network:NFC

Description

is Nfc Intent

Demo Code


//package com.java2s;

import android.content.Intent;

import android.nfc.NfcAdapter;

public class Main {

    public static boolean isNfcIntent(Intent intent) {
        if (intent != null) {
            String action = intent.getAction();
            if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)
                    || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
                    || NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)) {
                return true;
            }//from w w w.ja va 2 s .  c o m
        }
        return false;
    }
}

Related Tutorials