Last active
December 18, 2015 13:39
-
-
Save afjk/5791909 to your computer and use it in GitHub Desktop.
StickyNotesActivity::onNewIntent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onNewIntent(Intent intent) { | |
// NDEF exchange mode | |
if (!mWriteMode && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) { | |
NdefMessage[] msgs = getNdefMessages(intent); | |
promptForContent(msgs[0]); | |
} | |
// Tag writing mode | |
if (mWriteMode && NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { | |
Tag detectedTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); | |
writeTag(getNoteAsNdef(), detectedTag); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment