I have changed the intent to be as you have suggested, if I understand
correctly. I have also tried with and without singleTask in the
manifest for the launcher activity. With singleTask works a bit
better, but control still goes back to the AppStart activity when
clicking the notification, even through that is not where I was when I
pressed home.
My current code is:
<activity android:name=".AppStart"
android:label="@string/app_name"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
....
....
private void statusbarNotification() {
PendingIntent contentIntent = PendingIntent.getActivity(context,
0,
new Intent(Intent.ACTION_MAIN, null, context,
AppStart.class)
.addCategory(Intent.CATEGORY_LAUNCHER)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
0);
String text = "Notification message";
final Notification notification = new Notification(
R.drawable.icontabbar,
text,
System.currentTimeMillis());
notification.setLatestEventInfo(
context,
"Heading",
text,
contentIntent);
notification.defaults = Notification.FLAG_AUTO_CANCEL +
Notification.FLAG_ONLY_ALERT_ONCE;
nm.notify(NOTIFICATION_STATUS_ID, notification);
}
Any ideas please on what I need to change?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---