pradhan venugopal pradhan venugopal - 4 months ago 17
Android Question

How to check if NFC is enabled or not in android devices 6.0

For android 6.0 devices how to check if NFC is enabled or not.
Can anyone guide me with an example.
Thanks in advance.

Answer

This may work try this

NfcManager manager = (NfcManager)context.getSystemService(Context.NFC_SERVICE);
NfcAdapter adapter = manager.getDefaultAdapter();
if (adapter != null && adapter.isEnabled()) {
    // adapter exists and is enabled.
}
Comments