Launcher starts activites with:

Flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
Action = Intent.ACTION_MAIN
Category = Intent.CATEGORY_LAUNCHER

You can see it in the logcat:

02-26 18:55:39.863 I/ActivityManager( 273): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.jim2/.ConfigureMain bnds=[125,273][238,431] } from pid 673

The 0x10200000 is exactly those two flags.

Market and Eclipse use intents with slightly different flags.

This is a launch from Market:

02-26 18:54:11.133 I/ActivityManager( 273): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.jim2 cmp=com.jim2/.ConfigureMain } from pid 3715

Compared to the Launcher intent, the Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED is missing.

This is a launch from Eclipse:

[2012-02-26 19:01:16 - AquaMail] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=org.kman.AquaMail/.ui.AccountListActivity }

No flags at all (the missing Intent.FLAG_ACTIVITY_NEW_TASK is probably due to the process getting replaced anyhow).

The documentation for this missing flag says:

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED

If set, and this activity is either being started in a new task or bringing to the top an existing task, then it will be launched as the front door of the task. This will result in the application of any affinities needed to have that task in the proper state (either moving activities to or from it), or simply resetting that task to its initial state if needed.

Now, even if an app is launched from Market or Eclipse, when you press Home, the current activity get its onPause and onStop called.

Getting back to your original issue, I'd try to find out why you see a surface created, not destroyed.

-- Kostya

On 02/26/2012 06:26 PM, Jim Graham wrote:
On Sun, Feb 26, 2012 at 03:13:00PM +0100, YuviDroid wrote:
No problem :)

Unfortunately I don't really know what's happening..it seems like the
Installer launches apps in some 'strange' way, while the app drawer uses a
different way and...dunno something odd happens :S
(lol not really useful! eheh)
No, it's helpful...very much so.  It tells me I'm not the only one
who isn't making sense of this.  :-)  (seriously...I'd feel really
stupid if it was something obvious that I'd just missed; knowing that
I'm not the only one tells me that's not the case!)

If someone could explain that it would be great.
I'll second that!  I am incredibly curious about this one.....

Thanks!
    --jim


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to