Permalink
Browse files

Added TECH_DISCOVERED

  • Loading branch information...
1 parent 0fae149 commit 3f34b01f4af70ceda7e3a7381875cfb70beea44f @nadam committed Dec 22, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/se/anyro/nfc_reader/TagViewer.java
@@ -120,6 +120,7 @@ protected void onPause() {
private void resolveIntent(Intent intent) {
String action = intent.getAction();
if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
+ || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
NdefMessage[] msgs;
@@ -133,12 +134,7 @@ private void resolveIntent(Intent intent) {
byte[] empty = new byte[0];
byte[] id = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID);
Parcelable tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
- byte[] payload = null;
- try {
- payload = dumpTagData(tag).getBytes();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ byte[] payload = dumpTagData(tag).getBytes();
NdefRecord record = new NdefRecord(NdefRecord.TNF_UNKNOWN, empty, id, payload);
NdefMessage msg = new NdefMessage(new NdefRecord[] { record });
msgs = new NdefMessage[] { msg };

0 comments on commit 3f34b01

Please sign in to comment.