Simply, I have used the code here to open a URL in the Android's built-in web browser.
However, because I need to open many different URLs, I want to open and close the browser for every URL (instead of opening tabs).
Code for open a browser:
try {
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));
startActivity(myIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "No application can handle this request."
+ " Please install a webbrowser", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
I mean that my app can open a browser, and give the URL to load the website. However, if I give another URL, it will open as a new tab on the same opened browser. I do not need this especially when I want to run thousands of URLs. I want to open the browser and close it for every URL using my app. Is it possible? Can anyone help me with this?