I have an application that receives notification from Google Cloud Messaging. When user click on notification, i must open a special window from notification, so here is part of my app:
gcmintentservice:
final Intent i = new Intent(this, MapActivity.class);
i.putExtra("notification",true);
final PendingIntent contentIntent = PendingIntent.getActivity(
this, 0, i, PendingIntent.FLAG_CANCEL_CURRENT);
This puts extra flag "notification" to intent.
MapActivity.class - onResume():
if (getIntent().hasExtra("notification")) {
final Bundle extras = getIntent().getExtras();
notification = extras.getBoolean("notification");
} else {
notification = false;
}
Everything works fine, except one condition - when app is resumed from task list somehow "notification" extra is still passed to intent. How to avoid that?