WebView loadUrl works only once

后端 未结 14 1734
长情又很酷
长情又很酷 2020-12-14 01:49

EDIT: I worked on this project years ago and unfortunately I cannot verify if any of the answers is working in the given scenario.

I am having hard time with one Web

14条回答
  •  时光取名叫无心
    2020-12-14 02:21

    I was facing the same issue. I was creating a new Webview everytime. Just first destroy your previous webView before creating a new one. I hope this help!! Make your webview a global variable. Like -

    Webview w;

    then before creating a new webview just destroy the previous one

                    if(null != w)
                    {
                        //destroy the previous webview, before creating the new one
                        w.destroy();
                    }
                    w= new WebView(activity);
    

提交回复
热议问题