Webview不会执行网站命令,但chromeclient会执行 [英] Webview won't execute website commands, but chromeclient does

查看:113
本文介绍了Webview不会执行网站命令,但chromeclient会执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个WebView加载这个 WebSite



当您在识别框中放入一个数字并单击时,它会显示一个加载并告知标识是否正确,如果正确,它显示网站内的虚拟键盘,而不是设备键盘,如果不正确则显示错误。



错误



但是,如果我在我的WebView上放置相同的网站,它会完美地加载网站,但它不会执行这些命令,如果我输入任何标识并点击它不显示加载,它将不会做任何事情。



多数民众赞成有趣,因为它适用于iPhone的Xcode。



我的代码:



Hello,

I have a WebView that loads this WebSite

When you put a number inside the Identification box and click out, it shows a loading and tells if the Identification is correct or not, if it is correct, it shows a virtual keyboard within the website, not a device keyboard, if it is incorrect it shows a error.

Error

However, if i put the same website on my WebView, it loads the site perfectly, but it won't execute these commands, if i put any identification and click out it doesn't shows the loading, it won't do anything.

Thats funny, because it works normally with Xcode for iPhone.

My code:

package com.example.viskee.webview;

    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;

    public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WebView wbAba = (WebView) findViewById(R.id.wbAba);
        wbAba.setWebViewClient(new WebViewClient());

        wbAba.getSettings().setJavaScriptEnabled(true);
        wbAba.loadUrl("https://ib.rendimento.com.br");

        }
    }





我的尝试:



Javascript开启或关闭

插件开启或关闭(甚至已弃用)

CookieManager



OBS 如果我使用





What I have tried:

Javascript On or Off
Plugins On or Off(even deprecated)
CookieManager

OBS If i use

wbAba.setChromeClient(new ChromeClient);





它可以正常工作,但是我不想使用ChromeClient,因为它增加了地址栏等等。我想要我的WebView为全屏,仅显示网站。



It DOES works normally, however i don't want to use ChromeClient because it adds an address bar, etc. I want my WebView to be Fullscreen, and only show the website.

推荐答案

参见 WebView | Android开发者 [ ^ ] 。


刚刚开始工作。我所要做的只是



Just got it working. All i had to do was

wbAba.getSettings().setDomStorageEnable(true);


这篇关于Webview不会执行网站命令,但chromeclient会执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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