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 in Others by nisha
• 2,160 points
17 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 by polo
• 1,500 points

Related Questions In Others

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
1,516 views
0 votes
0 answers

how can I deploy a test in pytest framework to airflow using DAG?

I have established an automative testing framework ...READ MORE

Oct 4, 2021 in Others by Yuan
• 120 points
36 views
0 votes
1 answer

How do I UPDATE from a SELECT in SQL server?

In SQL Server, it is possible to insert ...READ MORE

answered May 30 in Others by anisha
• 140 points
18 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 in Others by Rahul
• 8,980 points
15 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 in Others by nisha
• 2,160 points
37 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 in Others by nisha
• 2,160 points
27 views
0 votes
1 answer

Android YouTube app Play Video Intent

The best way to run videos on ...READ MORE

answered Jun 6 in Others by nisha
• 2,160 points
30 views
0 votes
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 in Others by polo
• 1,500 points
38 views
0 votes
1 answer

Android open camera from button

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

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