Question Detail

How to Use HTML file in android?

6 years ago Views 1403 Visit Post Reply

Hello All,
In my assets folder, there is an HTML file. I want to call this HTML file in my android Application.
How can i Call HTML file in my android App?


Thread Reply

Hemant Sharma

- 6 years ago

// add a webview with id @+id/webwiev_ID to your main.xml layout file
WebView vbweb= (WebView)findViewById(R.id.webview_ID);


//Set your files Path here from Assets Folder
vbweb.loadUrl("file:///android_asset/YOUR_FILE_NAME.html");
Create HTML page in Android Studio