Android NFC and onNewIntent() -


when writing onnewintent(intent intent) method in nfc activity, neccessary/correct call super.onnewintent(intent) ?

i ask because official example includes it:

@override protected void onnewintent(intent intent) {     super.onnewintent(intent);     ...     if (intent != null && nfcadapter.action_ndef_discovered.equals(intent.getaction())) {         parcelable[] rawmessages =             intent.getparcelablearrayextra(nfcadapter.extra_ndef_messages);         if (rawmessages != null) {             ndefmessage[] messages = new ndefmessage[rawmessages.length];             (int = 0; < rawmessages.length; i++) {                 messages[i] = (ndefmessage) rawmessages[i];             }             // process messages array.             ...         }     } } 

but other official example doesn't:

public void onnewintent(intent intent) {     tag tagfromintent = intent.getparcelableextra(nfcadapter.extra_tag);     //do tagfromintent } 

presumably, second example incomplete (and incorrect) sure.

based on official documentation there's no reason call super.onnewintent(..).

as example check ondestroy() method documentation. includes next line:

derived classes must call through super class's implementation of method. if not, exception thrown.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -