android - onNewIntent() being called in onResume() multiple times -


my problem in onnewintent() function start new intent open contacts app , allow user complete process of creating new contact, when try exit contacts app , go app seems onnewintent() called again due block of code.

@override public void onresume() {     super.onresume();     // check see activity started due android beam     if (nfcadapter.action_ndef_discovered.equals(getintent().getaction())) {         processintent(getintent());     } } 

is there way clear intents once onnewintent (called processintent) has been called.

it looks call setintent() @ end of onnewintent() new intent has action value not trigger further processing.

here example, new intent activity set action of "do_nothing":

@override protected void onnewintent(intent intent) {     super.onnewintent(intent);      //do current processing here:     if (nfcadapter.action_ndef_discovered.equals(intent.getaction())) {         //process intent         //.........          // set intent activity new intent "do_nothing" action         intent = new intent();         i.setaction("do_nothing");         setintent(i);     } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -