wendux / DSBridge-Android

:earth_americas: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.
3.73k stars 613 forks source link

调用loadurl加载sdcard卡中的data文件夹中的html报错 #119

Open aibude opened 5 years ago

aibude commented 5 years ago

开发版本API26,执行 this.wv_browser.loadUrl("file://"+AppGlobal.SD_AContentPath+"ephspclient/view/activity/activity_manager_teacher.html");方法加载SDCard中路径的html页面时提示:net:ERR_ACCESS_DENIED无权限载入的情况,如加载在assets中的html文件就可以,原来使用原生的webview中的loadURL无此问题

wuh876 commented 5 years ago

解决了,需要在设置 webView.getSettings().setAllowFileAccess(true); 这样就可以打开了