You can use "abd shell dumpsys activity" to see the current activity stack
state.  That should show you what is different about the intent being
launched from the notification vs. the original one from the icon in
launcher.  (Also something to be aware of -- currently ADT launches
activities from eclipse slightly differently than home does, which can be
confusing.  Make sure to base all your work on what home does.)

On Tue, Aug 18, 2009 at 1:49 PM, Gustav Mauer <[email protected]> wrote:

>
> 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?
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to