Code example for NfcAdapter

Methods: enableForegroundDispatchsetNdefPushMessage

     * If this needs to be changed in the future, change what the message is, or list a different activity in 
     * setNdefPushMessage. 
    protected void enableNdefExchangeMode() { 
        adapter.setNdefPushMessage(message, activity);
        adapter.enableForegroundDispatch(activity, nfcPendingIntent, ndefExchangeFilters, null);
     * Call to disable any sort of exchange between NDEF devices. 
    protected void disableNdefExchangeMode() { 
//        passing a null value disables foreground NDEF push in the specified activity. 
        adapter.setNdefPushMessage(null, activity);
     * Gets the message from a text view and turns it into an NDEF Message and returns it as well as setting the message 
Connect your IDE to all the code out there  Get Codota for Java