Yes it looks like we have got confused here about what happens when
returning to the Home screen (perhaps your issue was the Eclipse
"feature" mentioned in the thread?).

In the interests of clearing up quite a bit of misinformation in this
thread, this is the what actually happens:

Re-launching the Activity from the Home screen returns to the same
Task that initially started that Activity (the one where action=MAIN
and category=LAUNCHER). But whatever Activity was on top of that old
Task is again the foreground Activity (unless clearTaskOnLaunch is
set).

The Activity listed in the Manifest with category LAUNCHER is NOT the
Activity that is active and setting singleTop is not necessary to get
this standard behavior.   Here is one place that this behavior is
outlined -

http://developer.android.com/intl/fr/guide/topics/manifest/activity-element.html#clear




On Jan 25, 1:08 pm, Josh Hoffman <keshis...@gmail.com> wrote:
> Thank you all for your help. I've tried some of the suggestions posted
> here and it seems like the main thing that was stopping me was not
> doing a full .apk build prior to each test. I implemented the
> android:launchMode="singleTop" manifest flag, but that didn't actually
> seem to get me my desired functionality. The only time I ever hit the
> onNewIntent() execution block was if I hit home from Activity1 and
> relaunched. Hitting home from Activity2 simply resulted in returning
> to Activity1 on relaunch.
>
> When I tested my app via adb install -l -r myApp.apk, the Android
> application stack seemed to finally behave itself. If I hit home from
> Activity2 and relaunch, I return to Activity2 exactly as I left it
> (thanks largely to Matthias Kaeppler's Droid-Fu and BetterAsyncTask, I
> might add).
>
> Just wanted to post and say that my issues seem to be resolved thanks
> to this new (if a bit cumbersome) development process of doing a full
> apk build. Thanks again for all the help!
>
> On Jan 24, 10:58 pm, String <sterling.ud...@googlemail.com> wrote:
>
> > On Jan 25, 12:54 am, jotobjects <jotobje...@gmail.com> wrote:
>
> > > If Activity1 and Activity2 are part of the same task and Activity2 is
> > > foreground when pressing the Home key, then I thought that choosing
> > > that app on the Home screen would return you to Activity2.
>
> > Something to remember is that "choosing that app on the Home
> > screen" (or in the Launcher drawer) is really clicking on a shortcut,
> > and that shortcut is specifically to the activity with this in your
> > manifest:
>
> >       <intent-filter>
> >         <action android:name="android.intent.action.MAIN" />
> >         <category android:name="android.intent.category.LAUNCHER" />
> >       </intent-filter>
>
> > It's also true (as another poster said) that installing your app from
> > Eclipse can change what its default activity is. If you want to
> > accurately simulate the behavior that  your users will see, you need
> > to build an APK as you would for release, install it through the
> > command line, and see what that does.
>
> > String

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