Thank you for your reply!

I am seeing am_task_to_front followed by am_finish_activity.
I found the event-log-tags file and apparently the reason is "clear".
What is not clear to me though is why the activity manager thinks it
should clear the the task.

The relevant lines of the log are:
I/am_on_resume_called(   94): com.android.launcher.Launcher
I/dvm_gc_info(   94):
[7017575181485176104,-9053780441931634733,-4010030953047537782,8554533]
I/force_gc(  209): bg
I/dvm_gc_info(  209):
[7163384747111232651,-9098816781953771608,-4017912252395432053,7919391]
I/am_pause_activity(   52):
[1128800640,com.android.launcher/.Launcher]
I/am_task_to_front(   52): 3
I/am_finish_activity(   52):
[1129575992,3,com.cequint.cityid/.About,clear]
I/am_destroy_activity(   52): [1129575992,3,com.cequint.cityid/.About]
I/am_new_intent(   52):
[1129518888,3,com.cequint.cityid/.UserLaunch,android.intent.action.MAIN,,,
274726912]
I/am_on_paused_called(   94): com.android.launcher.Launcher
I/am_resume_activity(   52):
[1129749080,3,com.cequint.cityid/.UserLaunch]
I/am_on_resume_called(  209): com.cequint.cityid.UserLaunch
I/dvm_gc_madvise_info(   94): [290816,245760]
I/dvm_gc_madvise_info(  209): [352256,241664]
I/force_gc(   94): bg

- John
On Mar 25, 10:16 am, Dianne Hackborn <hack...@android.com> wrote:
> You can do "adb logcat -b events" to see the event log which will include a
> line the activity manager prints when finishing an activity, with the reason
> why it is doing it.
>
>
>
>
>
> On Tue, Mar 24, 2009 at 7:24 PM, jseghers <jsegh...@cequint.com> wrote:
>
> > I am just starting on an Android app and I am puzzled about why my
> > Task activity stack is being reset any time the application is
> > launched from the Home screen.
>
> > I used the ADT tools to create the application in Eclipse.
> > The main activity is ".UserLaunch" and it starts the activity ".About"
> > when the user presses a button.
> > If the user then presses HOME and then relaunches the app, .UserLaunch
> > is displayed and is the only thing on the stack.
>
> > .UserLaunch has the launchMode singleTask. .About is standard.
> > According to the documentation at
> >http://developer.android.com/guide/topics/fundamentals.html#lmodes:
>
> >    "However, a "singleTask" activity may or may not have other
> > activities above it in the stack. If it does, it is not in position to
> > handle the intent, and the intent is dropped. (Even though the intent
> > is dropped, its arrival would have caused the task to come to the
> > foreground, where it would remain.) "
>
> > The Task stack should be brought to the foreground and .About should
> > still be displayed.
>
> > I added Logging to all of the lifecycle events (edited to remove
> > timestamps and shorten DEBUG/ and INFO/ to D/ and I/) and you can see
> > that when HOME is pressed, .About cycles through onPause and onStop
> > (as expected).  Then when the app is again launched, .About is
> > destroyed and .UserLaunch is restarted
>
> > D/UserLaunch:(670): onCreate()
> > D/UserLaunch:(670): onStart()
> > D/UserLaunch:(670): onResume()
> > I/ActivityManager(52): Displayed activity
> > com.cequint.cityid/.UserLaunch: 4910 ms
> > I/ActivityManager(52): Starting activity: Intent { comp=
> > {com.cequint.cityid/com.cequint.cityid.About} }
> > D/UserLaunch:(670): onPause()
> > D/About(670): onCreate()
> > D/About(670): onStart()
> > D/About(670): onResume()
> > I/ActivityManager(52): Displayed activity com.cequint.cityid/.About:
> > 1031 ms
> > D/UserLaunch:(670): onStop()
> > I/ActivityManager(52): Starting activity: Intent
> > { action=android.intent.action.MAIN categories=
> > {android.intent.category.HOME} flags=0x10200000 comp=
> > {com.android.launcher/com.android.launcher.Launcher} }
> > D/About(670): onPause()
> > D/About(670): onStop()
> > D/dalvikvm(670): GC freed 413 objects / 34128 bytes in 72ms
> > I/ActivityManager(52): Starting activity: Intent
> > { action=android.intent.action.MAIN categories=
> > {android.intent.category.LAUNCHER} flags=0x10200000 comp=
> > {com.cequint.cityid/com.cequint.cityid.UserLaunch} }
> > D/About(670): onDestroy()
> > D/UserLaunch:(670): onRestart()
> > D/UserLaunch:(670): onStart()
> > D/UserLaunch:(670): onResume()
>
> > Here is the relevant section of the Manifest:
>
> > <application android:icon="@drawable/icon" android:label="@string/
> > app_name">
> >  <activity android:name=".UserLaunch" 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 android:name=".About" android:launchMode="standard">
> >  </activity>
> > </application>
>
> > Anyone have any ideas why this is always resetting the Activity Stack?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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