How to get a list of installed android applications and pick one to run

后端 未结 19 1827
误落风尘
误落风尘 2020-11-21 06:26

I asked a similar question to this earlier this week but I\'m still not understanding how to get a list of all installed applications and then pick one to run.

I\'v

19条回答
  •  有刺的猬
    2020-11-21 07:25

    private static boolean isThisASystemPackage(Context context, PackageInfo  packageInfo ) {
            try {
                PackageInfo sys = context.getPackageManager().getPackageInfo("android", PackageManager.GET_SIGNATURES);
                return (packageInfo != null && packageInfo.signatures != null &&
                        sys.signatures[0].equals(packageInfo.signatures[0]));
            } catch (NameNotFoundException e) {
                return false;
            }
        }
    

提交回复
热议问题