PendingIntent from notification and application history conflicts
- by synic
I'm creating a notification with something similar to the following:
Intent ni = new Intent(this, SomeActivity.class);
ni.putExtra("somestring", "somedata");
PendingIntent contentIntent =
PendingIntent.getActivity(this, 0, ni,
PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_ONE_SHOT);
Context context = getApplicationContext();
notification.setLatestEventInfo(context,
res.getString(R.string.app_name),
text, contentIntent);
The key here is the extra data on the Intent for the notification. Once I click on the notification and it brings up SomeActivity, it brings up the activity and the extra data is available.
However, if I exit the app, hold the home button until the recent activities list comes up, and choose to open the app again, the extra data is still passed. Is there a way I can make this data get passed only if the app is opened via the Notification, and not from the recent activities list?