My problem is quite simple to explain:
I create a notification from a push service and start my activity with some extras:
notificationIntent = new Intent(getBaseContext(), MainActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
notificationIntent.putExtra("typeI",data.get("type"));
Log.e("DEBUG","PUT EXTRA");
PendingIntent pi = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
So, when I click my notification, I can read the type in my activity:
Log.e("DEBUG", "Extra -> " + getIntent().getStringExtra("typeI"));
And this is working fine.
The only annoyance is that I quit the application with the back button, Activity is destroyed, and when launching it again from the Launcher, I still get the extras!
So, I just tried to remove the extras, in my ACtivity, just after reading them just in case:
Log.e("DEBUG","REMOVE");
getIntent().removeExtra("typeI");
getIntent().putExtra("typeI","");
But that doesn't remove the extras, and next time I open the application Extras are still there.
Any idea what I am doing wrong?