0

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?

Mohsen Ali
  • 655
  • 1
  • 9
  • 30
  • Build-in? No. You dont say so. Its just a browser on your device. Not build-in your app or Android. – blackapps May 24 '22 at 10:06
  • `.... that I have opened it by code ...` You mean that you opened using ACTION_VIEW. – blackapps May 24 '22 at 10:09
  • You mean that you opened using ACTION_VIEW. :: YES. 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? – Mohsen Ali May 24 '22 at 12:19
  • Please edit your post instead of telling your problem in comments. – blackapps May 24 '22 at 12:25

0 Answers0