【问题标题】:How can I load a webpage with Google chrome instead of WebView in Android?如何在 Android 中使用 Google chrome 而不是 WebView 加载网页?
【发布时间】:2013-02-08 19:47:23
【问题描述】:

我想让用户通过点击一个按钮来访问我的网站。

但是,我希望应用打开 google chrome 或其他外部网络浏览器来打开网站,而不是使用 WebView 加载 url。

我该怎么做?

【问题讨论】:

    标签: android google-chrome android-webview


    【解决方案1】:

    您可以使用 ACTION_VIEW Intent 来做到这一点 --

    Uri myUri = Uri.parse("http://www.whereever.com/");
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(myUri);
    startActivity(intent);
    

    如果您想通过单击按钮执行此操作,则需要将其放入您的 onClickListeneronClick 方法中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-02
      • 1970-01-01
      • 1970-01-01
      • 2011-08-22
      • 1970-01-01
      • 1970-01-01
      • 2019-10-10
      • 1970-01-01
      相关资源
      最近更新 更多