Reputation: 19
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);
Upvotes: 1
Views: 95
Reputation: 1641
you cannot kill an application, its in the hands of Android OS. But you can finish the current activity by calling finish()
.
Upvotes: 1