I have a webview in my android app, the html file which gets loaded is on a server, however I need to address some files from app's assets folder. I wanted to ask how can I address those files.
Thanks
Asked
Active
Viewed 1,849 times
1 Answers
0
public class ViewWeb extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
WebView wv;
wv = (WebView) findViewById(R.id.webView1);
wv.loadUrl("file:///android_asset/aboutcertified.html"); // now it will not fail here
}
}
And in general you can use getAssets().open("filename.txt")) To get filea from assets On a side note:please put some code next time that you have triedget

Vaibhav Barad
- 625
- 8
- 17
-
Thanks Vaibhav , but I mean in the html file , not in the java code – m0j1 Oct 05 '15 at 03:14
-
Use getAssets().open("filename.txt")) to get files from assets – Vaibhav Barad Oct 05 '15 at 03:15
-
Thanks again Vaibhav , but I don't want java code, I want to load local android assets from an html file on the server. – m0j1 Oct 07 '15 at 15:11