1. 程式人生 > >webView載入Html5按鈕,JS不能呼叫問題的解決

webView載入Html5按鈕,JS不能呼叫問題的解決

最近專案中使用了html5 頁面,使用webView載入後發現 超連結的錨點不可以用,最後在stackOverflow中找到了解決辦法:

http://stackoverflow.com/questions/5899087/android-webview-localstorage

為webView設定下面兩句就好了:

mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setDatabaseEnabled(true);