Code example for NfcAdapter

Methods: setNdefPushMessage

0
    /** 
     * A method to turn clear out the previous message to be pushed. This allows the NFC device to listen for incoming 
     * ndef messages. 
     */ 
    public void clearPushMessage() { 
        adapter.setNdefPushMessage(null, activity);
    } 
 
    /** 
     * Gets the payload for a message from the array of NDEFmessages and then sets mPayload to that value and returns it. 
     * @return mPayload the payload for the ndefMessage in the first position in the messages array. 
     */ 
    public byte[] getBytePayload() { 
        mPayload = messages[0].getRecords()[0].getPayload();
        return mPayload;
    } 
 
    /** 
     * A getter for the current NdefMessage. 
     * @return message the current NdefMessage. 
     */