【问题标题】:Some URL are not opening in external Browser while invoking from app从应用程序调用时,某些 URL 未在外部浏览器中打开
【发布时间】:2013-04-15 02:11:32
【问题描述】:

当我尝试通过从我的应用程序调用本机浏览器来打开 URL 时,它不会从应用程序加载。它也不会启动浏览器。

我也没有得到任何例外。我用try/Catch。同样我用 webView 客户端也有,但没有出现任何异常。

                   WebView webview = new WebView(this);
                   webview.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
                           LayoutParams.FILL_PARENT));
                   webview.setBackgroundColor(0);
                   webview.setInitialScale(0);
                   webview.getSettings().setJavaScriptEnabled(true);
                   webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);

                   System.out.println("Within in WebView>>>> Before Load URL>>"+url);
                   webview.loadUrl(url);
                   webview.setWebViewClient(new HelloWebViewClient());

有人遇到过类似的问题吗?

【问题讨论】:

    标签: android android-webview android-browser


    【解决方案1】:

    此行会阻止您的链接加载外部浏览器:

    webview.setWebViewClient(new HelloWebViewClient());
    

    如果您想在浏览器中加载链接,请将其删除。好吧,如果我理解了你的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-02
      • 1970-01-01
      • 1970-01-01
      • 2016-08-29
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多