How can I open a URL in Android s web browser from my application

0 votes

How to open an URL from code in the built-in web browse?

Tied this:

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();
}

but I got an Exception:

No activity found to handle Intent{action=android.intent.action.VIEW data =www.google.com
Jun 14, 2022 in Others by nisha
• 2,210 points
4,202 views

1 answer to this question.

0 votes

ry this:

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);
answered Jun 14, 2022 by polo
• 1,480 points

Related Questions In Others

0 votes
1 answer

How can I store the data of an open excel workbook in a collection using BluePrism?

To do what you want is like ...READ MORE

answered Nov 24, 2022 in Others by narikkadan
• 63,420 points
907 views
0 votes
1 answer

How can I scrape a excel file from a website and divide it in different parts?

Use Scrapy or beautifulsoup4 parsing data it's more convenient ...READ MORE

answered Jan 13, 2023 in Others by narikkadan
• 63,420 points
396 views
0 votes
0 answers

How to handle large http response data from observer in Angular application to avoid browser crash?

Suppose we have a angular application which ...READ MORE

Apr 19, 2019 in Others by Hemant Gajbe
2,408 views
0 votes
0 answers

view-source of a web link in android

I trying to load "view-source:http://goo.gl/lEYQQf" link in webview. If ...READ MORE

Nov 17, 2022 in Android by Edureka
• 13,620 points
493 views
0 votes
1 answer

How to open the Google Play Store directly from my Android application?

By using developer.andriod.com, one can solve this ...READ MORE

answered Feb 8, 2022 in Others by Rahul
• 9,670 points
558 views
0 votes
1 answer

How to open YouTube video link in android app?

The below code will do that: Intent intent ...READ MORE

answered Jun 1, 2022 in Others by nisha
• 2,210 points
1,866 views
0 votes
1 answer

Launching Google Maps Directions via an intent on Android

We can open Google Maps app using ...READ MORE

answered Jun 1, 2022 in Others by nisha
• 2,210 points
1,050 views
+1 vote
1 answer

How To Create Phone Number Format XXX-XXX-XXXX In Android

 can try: private String formatNumbersAsCode(CharSequence s) { ...READ MORE

answered Jun 14, 2022 in Others by polo
• 1,480 points
8,331 views
0 votes
1 answer

Android open camera from button

you can use the below syntax as ...READ MORE

answered Jun 14, 2022 in Others by polo
• 1,480 points
1,193 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP