Read "payload" data on NFC tag?
<p>I’m using the following code to “read” an nfc tag: </p>

<pre><code>@Override
protected void onResume () {
    super.onResume();

    // read nfc tag....this is what will "read" the external record?
    if (getIntent().hasExtra(NfcAdapter.EXTRA_TAG)) {

        NdefMessage ndefMessage = this.getNdefMessageFromIntent(getIntent());

        if(ndefMessage.getRecords().length &gt; 0){

            NdefRecord ndefRecord = ndefMessage.getRecords()[0];

            String payload = new String(ndefRecord.getPayload());

            Toast.makeText(this, payload, Toast.LENGTH_SHORT).show();

        }

    }


    enableForegroundDispatchSystem();

}
</code></pre>

<p>I’m getting an error, saying that it “cannot resolve method getNdefMessageFromIntent” Is there another method that I should use to “read” the payload on the tag? Not sure how to fix this….Thanks for any help!!</p>