I have a singleTop
activity, this activity is launched via Intent
:
Intent intent = new Intent(GCMIntentService.this,MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
onNewIntent
is called.
My problem is that then I hit home button, and then launch application again (from background) onNewIntent
is called again with the same intent, and I can not find a way to discard this Intent
.
I tried to putExtra
flag to this intent, but it is not persisted between application state changes.
Is it possible to stop calling onNewIntent()
when application comes to foreground?