错误:无法解析上下文

时间:2015-07-06 15:07:52

标签: java android

出现以下错误:无法解决上下文

List<ApplicationInfo> packages;
PackageManager pm;
pm = getPackageManager();
//get a list of installed apps.
packages = pm.getInstalledApplications(0);

ActivityManager mActivityManager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);

for (ApplicationInfo packageInfo : packages) {
     if((packageInfo.flags & ApplicationInfo.FLAG_SYSTEM)==1)continue;
        if(packageInfo.packageName.equals("mypackage")) continue;
          mActivityManager.killBackgroundProcesses(packageInfo.packageName);
}      

0 个答案:

没有答案