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

