I have a locally stored HTML file in my assets folder that I am accessing through this:
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Global.setUpButton(this);
WebView webView = new WebView(this);
setContentView(webView);
//Sets up the settings for the webView
webView.loadUrl("file:///android_asset/map.html");
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.setInitialScale(0);
}
I was wondering if there is any way I would be able to view and/or edit the source of the HTML file loaded, as I may need to manipulate certain elements.
I found a workaround instead.
Created a JavascriptInterface that will allow me to append any HTML tags I need to. This is easier because I won’t have to reload the page, which reduces loading time.