从android captive门户浏览器上的链接打开外部应用程序

时间:2015-10-29 13:29:54

标签: android captivenetwork

我需要在Android浏览器中打开应用程序的页面,从Android浏览器用于登录强制网络门户网站,但这种做法的传统方式都不能作为market://链接和意图在此浏览器中工作< / p>

1 个答案:

答案 0 :(得分:-1)

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)));
}

希望它会对你有所帮助。