killing foreground android application
I created android application for getting all installed applications packages in device and then i select any one package i am launching the application using following code.
Intent LaunchIntents = getPackageManager().getLaunchIntentForPackage(appPacname);
After application is running 30 minutes I want to kill the launched application but it is not killing.I tried killing by using following statement activityManager.killBackgroundProcesses(selectedItemPkgName);
please help me to resolve the issue.