On May 17, 12:05 am, Dianne Hackborn <[email protected]> wrote:
> Okay wait... "the activity stack doesn't have A1" on it is NOT what you
> have been describing. In fact this is very very different. If A1 is going
> away, that means it is being finished, probably by you. Given that, my
> first question is, when you start A2, are you doing this *after* finishing
> A1? If so, you have finished A1 and its task before starting A2, so A2 is
> now in its own new task, and when you launch A1 from home it will need to
> start a new instance of the activity since the task it is being launched in
> does not contain it and is not rooted on A1.
No Dianne, I am absolutely, positively not finishing Activity A1
before starting A2. I know this is different from my previous post,
but I am trying to simplify the scenario. I will give you the _exact_
rundown of what I am doing in my very simple sample app, and I will
also include the "dumpsys activity" output of the state where I
finish.
1. Reboot phone.
2. Launch app from LAUNCHER icon. Activity A1 (the MAIN/LAUNCHER
activity) appears. Task Stack == A1.
3. Navigate to Activity A2 by hitting a button on A1. All the button
does is start Intent A2.class. Task Stack now equals == A1-->A2.
4. Hit HOME button.
5. Re-launch app from LAUNCHER icon. Screen shows A1 again (when I
believe it should resume to A2). Task Stack is inexplicably equal to
== A1-->A2-->A1.
Here is the "dumpsys acitvity" output for the #5 above:
Activity stack:
* TaskRecord{40814110 #7 A com.example}
clearOnBackground=false numActivities=3 rootWasReset=false
affinity=com.example
intent={flg=0x10000000 cmp=com.example/.MyActivityA1}
realActivity=com.example/.MyActivityA1
lastActiveTime=210296 (inactive for 41s)
* Hist #5: HistoryRecord{408db800 com.example/.MyActivityA1}
packageName=com.example processName=com.example
launchedFromUid=10026 app=ProcessRecord{40751fd8
756:com.example/10081}
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10600000
cmp=com.example/.MyActivityA1 }
frontOfTask=false task=TaskRecord{40814110 #7 A com.example}
taskAffinity=com.example
realActivity=com.example/.MyActivityA1
base=/data/app/com.example-1.apk/data/app/com.example-1.apk
data=/data/data/com.example
labelRes=0x7f040000 icon=0x7f020000 theme=0x0
stateNotNeeded=false componentSpecified=true
isHomeActivity=false
configuration={ scale=1.0 imsi=0/0 loc=en_US touch=3
keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=2}
launchFailed=false haveState=false icicle=null
state=RESUMED stopped=false delayedResume=false
finishing=false
keysPaused=false inHistory=true launchMode=0
fullscreen=true visible=true frozenBeforeDestroy=false
thumbnailNeeded=false idle=true
waitingVisible=false nowVisible=true
* Hist #4: HistoryRecord{407eaf98 com.example/.MyActivityA2}
packageName=com.example processName=com.example
launchedFromUid=10081 app=ProcessRecord{40751fd8
756:com.example/10081}
Intent { cmp=com.example/.MyActivityA2 }
frontOfTask=false task=TaskRecord{40814110 #7 A com.example}
taskAffinity=com.example
realActivity=com.example/.MyActivityA2
base=/data/app/com.example-1.apk/data/app/com.example-1.apk
data=/data/data/com.example
labelRes=0x7f040000 icon=0x7f020000 theme=0x0
stateNotNeeded=false componentSpecified=true
isHomeActivity=false
configuration={ scale=1.0 imsi=0/0 loc=en_US touch=3
keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=2}
launchFailed=false haveState=true
icicle=Bundle[mParcelledData.dataSize=204]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true launchMode=0
fullscreen=true visible=false frozenBeforeDestroy=false
thumbnailNeeded=false idle=true
* Hist #3: HistoryRecord{4053ab28 com.example/.MyActivityA1}
packageName=com.example processName=com.example
launchedFromUid=2000 app=ProcessRecord{40751fd8
756:com.example/10081}
Intent { flg=0x10000000 cmp=com.example/.MyActivityA1 }
frontOfTask=true task=TaskRecord{40814110 #7 A com.example}
taskAffinity=com.example
realActivity=com.example/.MyActivityA1
base=/data/app/com.example-1.apk/data/app/com.example-1.apk
data=/data/data/com.example
labelRes=0x7f040000 icon=0x7f020000 theme=0x0
stateNotNeeded=false componentSpecified=true
isHomeActivity=false
configuration={ scale=1.0 imsi=0/0 loc=en_US touch=3
keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=2}
launchFailed=false haveState=true
icicle=Bundle[mParcelledData.dataSize=204]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true launchMode=0
fullscreen=true visible=false frozenBeforeDestroy=false
thumbnailNeeded=false idle=true
* TaskRecord{405889e0 #2 A com.android.launcher}
clearOnBackground=true numActivities=1 rootWasReset=true
affinity=com.android.launcher
intent={act=android.intent.action.MAIN
cat=[android.intent.category.HOME] flg=0x10600000
cmp=com.android.launcher2/.Launcher}
realActivity=com.android.launcher2/.Launcher
lastActiveTime=210235 (inactive for 42s)
* Hist #2: HistoryRecord{406f99b8 com.android.launcher2/.Launcher}
packageName=com.android.launcher2
processName=com.android.launcher2
launchedFromUid=0 app=ProcessRecord{4063eb70
198:com.android.launcher2/10026}
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.HOME] flg=0x10000000
cmp=com.android.launcher2/.Launcher }
frontOfTask=true task=TaskRecord{405889e0 #2 A
com.android.launcher}
taskAffinity=com.android.launcher
realActivity=com.android.launcher2/.Launcher
base=/system/app/Launcher2.apk/system/app/Launcher2.apk data=/
data/data/com.android.launcher2
labelRes=0x7f0c0002 icon=0x7f020042 theme=0x7f0d0000
stateNotNeeded=true componentSpecified=false
isHomeActivity=true
configuration={ scale=1.0 imsi=0/0 loc=en_US touch=3
keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=2}
launchFailed=false haveState=true
icicle=Bundle[mParcelledData.dataSize=7720]
state=STOPPED stopped=true delayedResume=false finishing=false
keysPaused=false inHistory=true launchMode=2
fullscreen=true visible=false frozenBeforeDestroy=false
thumbnailNeeded=false idle=true
--
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