gpt4 book ai didi

android - 通过android captive portal浏览器上的链接打开外部应用

转载 作者:行者123 更新时间:2023-11-29 14:14:02 24 4
gpt4 key购买 nike

我需要通过android浏览器打开用于登录强制门户的Google Play应用程序中的应用程序页面,但是没有任何传统的方式(如market://链接和意图在此浏览器中工作)

最佳答案

final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName)));
}


希望对您有帮助。

关于android - 通过android captive portal浏览器上的链接打开外部应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33415606/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com