原本區(qū)分應(yīng)用渠道跳轉(zhuǎn)不同應(yīng)用市場,但是在小米手機(jī)上出現(xiàn)了無響應(yīng)的情況钝尸,最終放棄了跳轉(zhuǎn)指定應(yīng)用市場的方法括享,改為僅做跳轉(zhuǎn)不做控制;
String pkgName = context.getPackageName();
Uri uri = Uri.parse("market://details?id=" + pkgName);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
try {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return true;
} catch (Exception e) {
return false;
}
原本的跳轉(zhuǎn)區(qū)分:
when (channelId) {
"oppo" -> {
chanelName = "OPPO應(yīng)用商店"
intent.setClassName("com.oppo.market", "a.a.a.aoz")
}
"vivo" -> {
chanelName = "VIVO應(yīng)用商店"
intent.setClassName("com.bbk.appstore", "com.bbk.appstore.ui.AppStoreTabActivity")
}
"baidu" -> {
chanelName = "百度手機(jī)助手"
intent.setPackage("com.baidu.appsearch")
}
"anzhi" -> {
chanelName = "cn.goapk.market"
intent.setPackage("安智市場")
}
"huawei" -> {
chanelName = "華為應(yīng)用市場"
intent.setClassName("com.huawei.appmarket", "com.huawei.appmarket.service.externalapi.view.ThirdApiActivity")
}
"xiaomi" -> {
chanelName = "小米應(yīng)用商店"
intent.setClassName("com.xiaomi.market", "com.xiaomi.market.ui.AppDetailActivity")
}
"meizu" -> {
chanelName = "魅族應(yīng)用商店"
intent.setClassName("com.meizu.mstore", "com.meizu.flyme.appcenter.activitys.AppMainActivity")
}
"samsung" -> {
chanelName = ""
intent.data = Uri.parse("http://www.samsungapps.com/appquery/appDetail.as?appId=$apkName")
intent.setClassName("com.sec.android.app.samsungapps", "com.sec.android.app.samsungapps.Main")
}
"360" -> {
chanelName = "360手機(jī)助手"
intent.setClassName("com.qihoo.appstore", "com.qihoo.appstore.distribute.SearchDistributionActivity")
}
"yingyongbao" -> {
chanelName = "應(yīng)用寶"
intent.setClassName("com.tencent.android.qqdownloader", "com.tencent.pangu.link.LinkProxyActivity")
}
"wandoujia" -> {
chanelName = "豌豆莢"
intent.setClassName("com.wandoujia.phoenix2", "com.pp.assistant.activity.PPMainActivity")
}
"pp" -> {
chanelName = "PP助手"
intent.setClassName("com.pp.assistant", "com.pp.assistant.activity.MainActivity")
}
"ali" -> {//pp助手珍促,豌豆莢铃辖,淘寶手機(jī)助手,九游猪叙,UC應(yīng)用商城娇斩,神馬搜索
//TODO
chanelName = "應(yīng)用市場"
intent.setPackage("")
}
else -> {
chanelName = "應(yīng)用寶"
intent.setClassName("com.tencent.android.qqdownloader", "com.tencent.pangu.link.LinkProxyActivity")
}
}
2020-04-26