I'm trying to stop "com.android.uninstaller.UnistallerActivity" when appeared i use following code:
public static void killThisPackageIfRunning(final Context context, String packageName){
ActivityManager activityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.killBackgroundProcesses(packageName);
}
and call it like that:
killThisPackageIfRunning(getApplicationContext(),"com.android.uninstaller.UnistallerActivity");
// and
killThisPackageIfRunning(getApplicationContext(),"com.android.uninstaller");
but doesn't work! i'm doing something wrong? or it's not the best way to do that?
I get Invalid packageName: com.android.uninstaller.UnistallerActivity error!
is there another name for uninstaller activity, or because it's an activity and killBackgroundProcesses
don't kill activities?
i know there another way to kill apps:
Process.sendSignal(pid, Process.SIGNAL_KILL);
but does it gd solution to stop system activity? how to know pid of UnistallerActivity if it's started?
i know it's not something simple but is there a hack (things of superuser permission to do that?)
any indication / idea / discussion would be appreciated.