####在app判断手机里面某个app是否安装,调用此方法即可,前提是要知道要判断点app的包名,像微信这类应用,百度一下就知道包名了
private boolean isAppInstalled(Context context, String packagename) {
PackageManager pm = context.getPackageManager();
boolean installed = false;
> try {
> pm.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES);
> installed = true;
. } catch (PackageManager.NameNotFoundException e) {
> installed = false;
> }
> return installed;
>}
网友评论