android - Stop a running app you just started -


have trouble stopping app start startactivity. here how start it:

intent theapp = new intent(); theapp = getpackagemanager().getlaunchintentforpackage(thepackagename);                            theapp.addcategory(intent.category_launcher);                            theapp.addflags(intent.flag_activity_new_task);                            getapplicationcontext().startactivity(theapp); 

after has ran awhile, im trying stop this:

                               if(stopservice(theapp))                                    log.d(tag,"stopped app successfully!");                                else                                    log.d(tag,"failed stop app!"); 

any ideas why isnt working? in advance help

it seems starting activity. , trying stop service, not work. if want stop whole application. can use system.exit().


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -