Example usage for android.nfc NfcAdapter enableForegroundNdefPush

List of usage examples for android.nfc NfcAdapter enableForegroundNdefPush

Introduction

In this page you can find the example usage for android.nfc NfcAdapter enableForegroundNdefPush.

Prototype

@Deprecated
public void enableForegroundNdefPush(Activity activity, NdefMessage message) 

Source Link

Document

Enable NDEF message push over NFC while this Activity is in the foreground.

Usage

From source file:Main.java

public static void enableNFCWriteMode(Activity activity, NfcAdapter nfcAdapter, String textToWrite) {
    NdefRecord textRecord = createTextRecord(textToWrite, true);
    NdefMessage msg = new NdefMessage(new NdefRecord[] { textRecord });
    nfcAdapter.enableForegroundNdefPush(activity, msg);
}