I have a html file which I am opening by launching the HTML viewer. Is there a way to tell HTML viewer from my app to close the page?
Here is the code I am using to launch the html file
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
File file = new File("/data/data/Sample.html");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "text/html");
startActivity(intent);
Yes i am sure you want to view this HTML file inside your application instead of launching native browser. If this is the case then create WebViewClient and set it inside the WebView.
For example:
and set it inside the webview as:
and then load that URL into the WebView actually. Here is the detailed example.