Android WebView:为什么我不能从WebView重定向到播放商店? [英] Android WebView : Why I can not able to redirect to play store from WebView?

查看:246
本文介绍了Android WebView:为什么我不能从WebView重定向到播放商店?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将网址传递到应该重定向到Play商店的Webview,但它不起作用.

I am trying to pass url to webview that should redirect to play store but Its not working.

我尝试过的事情:

String url = "https://play.google.com/store/apps/details?id=com.matchify";
webView.loadUrl(url);

但是它仅加载到webview中,我该如何解决呢?

but its loading only inside the webview, how can I solve this?

预先感谢

推荐答案

要在Play商店应用上打开您的应用/其他任何应用的页面,请使用:

To open your app's / any other app's page on play store app use :

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackName)));

其中的appPackName是:

Where appPackName is:

 String appPackName = getPackageName();

Play Store应用程序具有意图过滤器,该过滤器将监听意图并启动uri(因为它以market://开头,它将打开Play商店.)如果要在浏览器中打开,请使用uri参数:

Play Store app has Intent Filter that will listen to the intent and launch the uri (since it is starting with market:// it will open Play Store. ) If you want to open in browser use uri argument :

https://play.google.com/store/apps/details?id=" + appPackName

有用的链接:如何直接从我的Android应用程序打开Goog​​le Play商店?

这篇关于Android WebView:为什么我不能从WebView重定向到播放商店?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆