Technically you can do that, yes. However, I would only do that if it is absolutely necessary and I would make it very clear to the user that that is what you are doing. Android Apps have a very specific lifecycle, as defined in the Dev Guide, and users expect that to be the way applications work.
They will get very annoyed if that is not followed unless it is for a very good reason. One particular example that is extremely irritating is when applications override the default behavior of the back button. If I press the back button I am wanting to exit the app. When that is not followed it is very frustrating. Thanks, Justin ---------------------------------------------------------------------- There are only 10 types of people in the world... Those who know binary and those who don't. ---------------------------------------------------------------------- On Mon, Sep 28, 2009 at 2:39 PM, Shude Zheng <[email protected]> wrote: > Hi, Justin, > > Can I use similar function call Home using startActivity() in the child > application. Do not use the Home button. Because I want keep the child > application alive and directly back to home. > > Thanks, > > Shude > > On Tue, Sep 22, 2009 at 5:14 PM, Shude Zheng <[email protected]> wrote: > >> Thanks, Justin. >> >> This is what I want to know. >> >> Shude >> >> On Tue, Sep 22, 2009 at 3:59 PM, Justin Anderson <[email protected] >> > wrote: >> >>> Yes you can do that. I have a program on the market, AppSwipe!, that >>> essentially does only that. The Dev Guide states: >>> >>> "The general mechanism to start a new activity if its not running— or to >>> bring the activity stack to the front if is already running in the >>> background— is the to use the NEW_TASK_LAUNCH flag in the startActivity() >>> call." >>> >>> This is found on this page: >>> http://developer.android.com/guide/appendix/faq/framework.html#4 >>> >>> Thanks, >>> Justin >>> >>> ---------------------------------------------------------------------- >>> There are only 10 types of people in the world... >>> Those who know binary and those who don't. >>> ---------------------------------------------------------------------- >>> >>> >>> On Tue, Sep 22, 2009 at 2:47 PM, Shude Zheng <[email protected]>wrote: >>> >>>> Thanks, Justin, >>>> >>>> I have fixed the crash. But I still have some questions. >>>> >>>> I have two my own applications, for example, Parent and Child. There is >>>> button in Parent applicaiton to launch Child. It uses the ApplicationInfo >>>> code get the name and activity of Child and uses startActivity() to launch >>>> Child. Child will run. At that time the Parent is atill alive at >>>> background. The Child Uses similar function. it will launch the Parent. But >>>> at that time Parent is still alive. Can I use atartActivity() to let the >>>> Parent run in front. The doc said atartActivity is for new activity. >>>> >>>> Shude >>>> >>>> On Tue, Sep 22, 2009 at 10:25 AM, Justin Anderson < >>>> [email protected]> wrote: >>>> >>>>> The following will get you a list of all applications on your phone as >>>>> ApplicationInfo objects (assuming you have a Context object): >>>>> >>>>> PackageManager mgr = context.getPackageManager(); >>>>> ArrayList<ApplicationInfo> appList = >>>>> (ArrayList<ApplicationInfo>)mgr.getInstalledApplications(0); >>>>> >>>>> Hope this helps, >>>>> Justin >>>>> >>>>> ---------------------------------------------------------------------- >>>>> There are only 10 types of people in the world... >>>>> Those who know binary and those who don't. >>>>> ---------------------------------------------------------------------- >>>>> >>>>> >>>>> On Tue, Sep 22, 2009 at 1:36 AM, Sean Hodges < >>>>> [email protected]> wrote: >>>>> >>>>>> I think he's trying to launch the Youtube app >>>>>> >>>>>> On Sep 22, 2009 7:29 AM, "Justin Anderson" <[email protected]> >>>>>> wrote: >>>>>> >>>>>> Are you trying to launch an activity that you created, or an arbitrary >>>>>> third party app? >>>>>> >>>>>> Thanks, >>>>>> Justin >>>>>> ---------------------------------------------------------------------- >>>>>> There are only 10 types of people in the world... >>>>>> Those who know binary and those who don't. >>>>>> ---------------------------------------------------------------------- >>>>>> >>>>>> On Fri, Sep 18, 2009 at 7:46 AM, Abhi <[email protected]> >>>>>> wrote: > > > Hi, > > After se... >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

