Kitkat kills: Not allowed to load local resource: file:///android_asset/webkit/android-weberror.png

后端 未结 8 1089
半阙折子戏
半阙折子戏 2020-11-30 03:54

I have an app that uses WebViews. I\'ve changed my targetAPI from 18 to 19 and I\'m currently testing on the new 4.4. For some reason I\'m getting this error: Not allo

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 04:31

    The solution below works for me.

    webview.loadDataWithBaseURL( baseUrl, htmlStr, "text/html", "UTF-8", "");
    

    where baseUrl is your external domain, not file:///android_asset/ (i.e. http://a.domain.com ).

提交回复
热议问题