1

My application contains a CountDownTimer (15 minutes) and a list of applications (Browser, calculator, Music, ..). what I want is when I run an application from this list, the selected application starts normally and closes once the counter is finished.

I use this code to start selected application:

Intent intent = packageManager.getLaunchIntentForPackage(app);
        startActivity(intent);
Afef
  • 19
  • 4

1 Answers1

1

you cannot kill an application, its in the hands of Android OS. But you can finish the current activity by calling finish().

Aman Grover
  • 1,621
  • 1
  • 21
  • 41
  • Not sure that answered to the question. The OP wants to finish an "external" app from his own application. And you can [kill an app](http://stackoverflow.com/q/2092951/2668136) (with `killProcess`) but as you said, it's really not recommended! – Blo May 10 '14 at 16:58