My problem is that in onNewIntent() function I start a new intent to open contacts app and allow the user the complete the process of creating a new contact, but when I try to exit the contacts app and go back to my app it seems that onNewIntent() is called again most likely due to this block of code.
@Override
public void onResume() {
super.onResume();
// Check to see that the Activity started due to an Android Beam
if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
processIntent(getIntent());
}
}
Is there a way to clear intents once onNewIntent (called by processIntent) has been called.
It looks like you could just call
setIntent()
at the end ofonNewIntent()
with a new Intent that has an Action value that will not trigger further processing.Here is an example, where the new Intent for the Activity is set with an Action of "do_nothing":