【问题标题】:Android WebView : Why I can not able to redirect to play store from WebView?Android WebView:为什么我无法从 WebView 重定向到播放商店?
【发布时间】:2015-05-11 15:06:02
【问题描述】:

我正在尝试将 url 传递给应该重定向到 play store 但它不起作用的 webview。

我尝试了什么:

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

但它只能在 webview 中加载,我该如何解决这个问题?

提前致谢

【问题讨论】:

  • 使用 Intent 代替 ...
  • 没关系。是否可以从 webview 到 play store?

标签: android webview uiwebview android-webview webviewclient


【解决方案1】:

要在 Play 商店应用中打开您的应用/任何其他应用的页面:

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

appPackName 在哪里:

 String appPackName = getPackageName();

Play 商店应用具有 Intent 过滤器,它将侦听意图并启动 uri(因为它以 market:// 开头,它将打开 Play 商店。)如果您想在浏览器中打开,请使用 uri 参数:

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

有用的链接:How to open the Google Play Store directly from my Android application?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多