Code example for NfcAdapter

Methods: disableForegroundDispatchsetNdefPushMessage

     * 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 
     * field. 
     * @param view The textView that contains the text to be turned into a message. 
     * @return Returns a new NdefMessage from the text. 
    protected NdefMessage getTextViewAsNdef(TextView view) {
        byte[] textBytes = view.getText().toString().getBytes();
        NdefRecord textRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, mimeType.getBytes(),
                new byte[] {}, textBytes);
        message = new NdefMessage(new NdefRecord[] {