Web视图不加载HTML内容 [英] Web View Not Loading HTML content

查看:148
本文介绍了Web视图不加载HTML内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加载网页视图内检查字符串

I am loading check string inside a webview

String Check = "<html><body><form action=\"https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/**ID**\" id=\"BB_BuyButtonForm\" method=\"" +
            "post\" name=\"" +"BB_BuyButtonForm\" target=\"_top\">"
            +"<input name=\"item_name_1\" type=\"hidden\" value=\"Carbon Emission\"/>"
            +"<input name=\"item_description_1\" type=\"hidden\" value=\"Pay for carbon emission. \"/>"
            +"<input name=\"item_quantity_1\" type=\"hidden\" value=\"1\"/>"
            +"<input name=\"item_price_1\" type=\"hidden\" value=\"ffff\"/>"
            +"<input name=\"item_currency_1\" type=\"hidden\" value=\"USD\"/>"
            +"<input name=\"_charset_\" type=\"hidden\" value=\"utf-8\"/>"
            +"<input alt=\"\" src=\"https://sandbox.google.com/checkout/buttons/buy.gif?merchant_id=**ID**&amp&w=117&amp&h=48&amp&style=trans&amp&variant=text&amp&loc=en_US\" type=\"Button\"/>"
            +"</form></body></html>";

然后我支票装入串的WebView

Then i loading check string to webview

        webview.loadData(Check, "text/html", "UTF_8");

其显示白色画面

推荐答案

非常感谢你到尿布和Sandy。

Thank you very much to Nappy and Sandy.

最后我解决我的problem.It是因为安全的HTTPS URL。这让我们不得不避免SSL错误不会在网页视图直接运行的

Finally i solved my problem.It was because of secure url https .This will not run in webview directly so we have to avoid the ssl error

webview.setWebViewClient(new WebViewClient(){

        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            pd.dismiss();
        }

        @Override
        public void onReceivedSSLError(WebView view, int errorCode,
                String description, String failingUrl) {
            super.onReceivedError(view, errorCode, description, failingUrl);                 
      view.proceed();
        }

    });

这篇关于Web视图不加载HTML内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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