Code example for NfcManager

Methods: getDefaultAdapter

0
        return wm.isWifiEnabled();
    } 
 
    private boolean isNfcEnabled() { 
        NfcManager nm = (NfcManager) getActivity().getSystemService(Context.NFC_SERVICE);
        NfcAdapter na = nm.getDefaultAdapter();
        return (na != null) && na.isEnabled();
    } 
 
    private boolean isAndroidBeamEnabled() { 
        NfcManager nm = (NfcManager) getActivity().getSystemService(Context.NFC_SERVICE);
        NfcAdapter na = nm.getDefaultAdapter();
        return (na != null) && na.isNdefPushEnabled();
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE