WebView returns bad window.innerHeight

前端 未结 4 1122
太阳男子
太阳男子 2021-02-14 01:23

I have an application that makes use of the Android WebView, as well as some JavaScript. When my WebViewClient calls onPageFinished(), I alert my JavaScript to run

4条回答
  •  不知归路
    2021-02-14 01:50

    After some reading,another solution has occured. in java code, we can use

    new Handler().post(new Runnable(){ 
        @Override 
        public void run(){
            webview.loadUrl("...")
        }
    }); 
    

    add it to QueueMessage,and delayed the js to execute,and it works.

提交回复
热议问题