I am trying to open local html file in my Android application.
The file is located under my assets folder. So I am setting a WebViewClient and loading my page into i
I think, It'd better use "raw" folder. That code works properly.
InputStream is = getResources().openRawResource(R.raw.html_file);
try {
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
String str = new String(buffer);
}catch (IOException e){
e.printStackTrace();
}
webView.loadDataWithBaseURL("", str, "text/html", "UTF-8", "");