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);