Tuesday, August 30, 2011

[android-developers] Re: NdefRecord(NdefMessage) extraction from the intent in a NFC design

> Though, some of the extras, especially
> EXTRA_NDEF_MESSAGES, might be null.
All the extras provided by an intent behave as a map, i.e. if the
extra is not defined, then null is returned, so you can also ask for
the extra
intent.getStringExtra("android.nfc.extra.SOMETHING")
and you will get null as result (as this entry is not available);
exceptions are never thrown.

So if you say that EXTRA_NDEF_MESSAGES might be null, this means that
this extra is not available. According to the documentation, only
getParcelableExtra(NfcAdapter.EXTRA_TAG) is guaranteed to be non-null.
Dominik

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate