Sent from my BlackBerry® smartphone from !DEA -----Original Message----- From: Josh Hoffman <keshis...@gmail.com> Date: Sat, 23 Jan 2010 14:22:48 To: Android Developers<android-developers@googlegroups.com> Subject: [android-developers] Re: Launching the correct activity on resume
Thanks for your help Vo Trung Liem, I think I may not have been clear enough about what I'm trying to do. I don't have any trouble getting back to Activity1 (my launcher) from Activity2 (results). What I want is this: Launch app into Activity1 from the home screen. Go into Activity2 from Activity1 after choosing options. Be able to hit the 'Home' key and use other apps while my app does work. Launch app into Activity2 from the home screen. What I currently have is an app that will only ever launch into Activity1 from the home screen no matter what I do. It doesn't seem to care whether Activity2 was on top of the stack when I hit home, which tells me I probably don't understand the Android Lifecycle as well as I should. I should probably also mention that I am using android:launchMode="singleTask" as I am under the impression that this makes sure I only ever have one instance of my application floating around. Thanks again for reading and for any help you may be able to offer! On Jan 22, 6:21 pm, Vo Trung Liem <lie...@gmail.com> wrote: > Hi, > > No need set up your Manifest to get this functionality. > > You just use function onActivityResult() to code for your functionality. > > Example: > > Activity1 call Activity2 then Activity1 will resume after Activity2 finish. > > Activity1 will call Activity2 by function: startActivityForResult(intent, > requestCode); > > In Activity2, we need implement function onActivityResult() what you want. > (Example: setResult(0); > this.finish();) > > Hope you success! > > On Sat, Jan 23, 2010 at 7:09 AM, Josh Hoffman <keshis...@gmail.com> wrote: > > I'm currently working with a two-activity application. The first > > activity allows the user to choose options for their upload, and the > > second activity displays a ListView of their results once processed. > > > I have code in place that performs the uploads/downloads in the > > background, regardless of whether the application is currently in > > focus or not (thanks to Matthias Kaeppler's Droid-Fu). > > > I would like to have my application Resume into my second (results) > > activity when a user clicks on the icon from the top-level launcher, > > regardless of how long they have been away from the app. I thought > > that the 'alwaysRetainTaskState' flag in the Manifest would do it, but > > I've not had success with that. Can anyone tell me how I need to set > > up my Manifest to get this functionality? > > > Thank you for your help! :) > > > -- > > 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<android-developers%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- 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 -- 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