How do I make my application run a saved html file in a folder within the application?
How do I make my application run a saved html file in a folder within the application?
Just open the file in a WebView .
Add to WebView
I your layout file:
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
And in your Activity
you load the contents of the file, like this:
setContentView(R.layout.my);
WebView mWebView = null;
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("file:///android_asset/new.html"); //local do arquivo .html
For other examples, you can look at this question.