I\'m using Android Studio/Gradle.
app\\src\\main\\android_asset folder has the file called chart.html..
I\'m trying to load this file to my webview like this
Answer from Gugelhupf but with raw resource.
Advantage from this solution: you keep translation working!
WebView webView = findViewById(R.id.about_text);
try {
InputStream inputStream = getResources().openRawResource(R.raw.about);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder stringBuilder = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line).append("\n");
}
webView.loadDataWithBaseURL(null, stringBuilder.toString(), "text/html", "UTF-8", null);
} catch (IOException e) {
e.printStackTrace();
}