判断手机中是否安装了 微信 app

判断手机中是否安装了微信, 有两个方法
1.获得android中,所有安装的app的列表
然后比对微信的包名进行比较,然后得出结论

2.通过 微信提供的 api 方法进行判断是否有 微信安装 。

// 是否安装微信
boolean installedWx = Application.mWxApi.isWXAppInstalled();
//未安装微信
if (!installedWx) {
    ToastUtil.showLongToast(context, "未安装微信");
    return;
}

猜你喜欢

转载自blog.csdn.net/yanxiangxue/article/details/110823866