java - How to kill all active processes from Android phone with code in my app? -
hi
how kill active processes android phone code in app? read couple of articles how kill running applications in android? , tried code:
list<applicationinfo> packages; packagemanager pm; pm = getpackagemanager(); //get list of installed apps. packages = pm.getinstalledapplications(0); activitymanager mactivitymanager = (activitymanager)context.getsystemservice(context.activity_service); log.d("packages" , string.valueof(packages)); (applicationinfo packageinfo : packages) { mactivitymanager.killbackgroundprocesses(packageinfo.packagename); log.d("cleaned" , string.valueof(packageinfo.packagename)); }
logcat show me active processes, no of them have closed/nothing happens.
yes, have included in manifest:
<uses-permission android:name="android.permission.kill_background_processes" />
i there i'm missing?
Comments
Post a Comment