Afef
Afef

Reputation: 19

how to close application once a CountDownTimer is finished?

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

Answers (1)

Aman Grover
Aman Grover

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

Related Questions