Created
November 9, 2017 13:59
-
-
Save ssaurel/32ae0738edebfa3159a489ebaa708255 to your computer and use it in GitHub Desktop.
displayMsgs method for the NFC Reader tutorial
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
private void displayMsgs(NdefMessage[] msgs) { | |
if (msgs == null || msgs.length == 0) | |
return; | |
StringBuilder builder = new StringBuilder(); | |
List<ParsedNdefRecord> records = NdefMessageParser.parse(msgs[0]); | |
final int size = records.size(); | |
for (int i = 0; i < size; i++) { | |
ParsedNdefRecord record = records.get(i); | |
String str = record.str(); | |
builder.append(str).append("\n"); | |
} | |
text.setText(builder.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment