Android webview 加载本地文件

来源:互联网 发布:cad导入excel表格数据 编辑:程序博客网 时间:2024/05/17 22:57


在eclipse  里面与 Android  studio 里面略有不同, 不注意的话, 总是会报告“文件找不到” 的错误信息;



eclipse 放置文件夹 assets 到  project/下面


但是  android studio 里面 需要放置  assets  到   project/app/src/main 下面




4down voteaccepted

The html file should be placed in the assets folder (note the spelling), which will belong in the root directory of your project.

So move

src/main/assests/index.html

to

assets/index.html

In an Android Studio project use this folder:

/app/src/main/assets/index.html





4down voteaccepted

The html file should be placed in the assets folder (note the spelling), which will belong in the root directory of your project.

So move

src/main/assests/index.html

to

assets/index.html

In an Android Studio project use this folder:

/app/src/main/assets/index.html
0 0