And here is what logcat outputs when launching the app from the "Open"
button, and from the app tray. Looks like it's using a different way
of opening from the app tray:
// When starting from the app tray:
INFO/ActivityManager(1714): Starting activity:
Intent { action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x10200000 comp=
{com.test.testapp/com.test.testapp.ActivityA} }
// When starting from the "Open" button through the browser:
INFO/ActivityManager(1714): Starting activity:
Intent { action=android.intent.action.MAIN flags=0x10000000 comp=
{com.test.testapp/com.test.testapp.ActivityA} }
Thanks
On Dec 4, 12:06 pm, Mark Wyszomierski <[email protected]> wrote:
> Hi niko,
>
> I think this is just a bug with launching the downloaded apk from the
> "Open" button of the browser. The default behavior of an android app
> (with restoring to the correct point in the activity stack) doesn't
> require the singleTask flag. The alwaysRetainTaskState flag shouldn't
> be necessary in this test either - it only remembers state over longer
> periods of time, here I'm resuming the app within seconds to
> demonstrate the quirky behavior.
>
> I've tried this with other 3rd party apps I downloaded, same behavior.
> Download the APK, install, hit the "Open" button, get the history
> stack problem. Do the same procedure, only instead of hitting "Open",
> hit "Done", launch the app from the app tray, and it works perfectly
> as expected. This same exact quirky behavior is seen when trying to
> launch apps from eclipse, rather than from the app
> tray:http://code.google.com/p/android/issues/detail?id=2373&q=first%20%20i...
>
> Thanks
>
> On Dec 4, 10:39 am, niko20 <[email protected]> wrote:
>
> > Hi,
>
> > You need to look into Activity lifecycles and the "launchMode"
> > attribute in the activity manifest. You probably want singleTask and
> > also the "alwaysRetainTaskState" attribute too...
>
> > Look it up to see what I mean.
>
> > -niko20
>
> > On Dec 4, 3:03 am, Mark Wyszomierski <[email protected]> wrote:
>
> > > Actually I found this very important step which is definitely causing
> > > it:
>
> > > -User downloads APK through the browser.
> > > -User installs.
> > > -User then gets prompted with two buttons: "Open" or "Done".
> > > - ** If you hit "Open", this starts the quirky behavior with the
> > > incorrect history stack.
> > > - ** If you hit "Done", and launch the app from the app tray, it
> > > works perfectly.
>
> > > So it looks like the system/browser does something to the history of
> > > your app when launched through the "Open" button. Can anyone verify
> > > this? This is almost the same exact bug as launching the app from
> > > eclipse. Only in this case, eclipse is replaced by the browser.
>
> > > Thanks
>
> > > On Dec 4, 1:34 am, Mark Wyszomierski <[email protected]> wrote:
>
> > > > Hi,
>
> > > > I just experienced this behavior on four different phones, 1.5 to 2.0.
>
> > > > I made a brand new app. It's simply two activities, A and B. Activity
> > > > A launches B. That's all it does. Rest is wizard generated template
> > > > code.
>
> > > > When the user installs the app (via web url apk), and runs it for the
> > > > *first* time, I get an out-of-order activity stack:
>
> > > > -User starts the app, A is on top.
> > > > -They make A launch B by clicking a button. B is on top of the
> > > > stack.
> > > > -User hits the home screen button.
> > > > -User returns to the app, A is displayed, instead of B.
> > > > -User hits the back key, B is shown!
> > > > -User hits the back key again, A is shown!
> > > > -User hits the back key again, home screen shown.
> > > > -Now the stack is clean, and app behaves "normally" from now on!
>
> > > > Is any one else seeing this? This is almost exactly like this known
> > > > bug, however my users are not installing from
> > > > eclipse:http://code.google.com/p/android/issues/detail?id=2373&q=first%20%20i...
>
> > > > I can provide the test app/source if anyone wants to try,
>
> > > > Thanks
>
>
--
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