Saturday, April 11, 2009

Open URL/Website from android

Here is a small piece of code to open a URL/Website from your application, place it on your class that has startActivity function, for example your class that extends Activity

String url = "http://almondmendoza.com/android-applications/";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);


Hope this helps.

12 comments:

Anonymous said...

Simple and effective!

AlexR said...

10x a lot!

Anonymous said...

Good solution. thx

Anonymous said...

nice !

android development said...

The code worked,interesting code, to open the url of a website from our application.

Anonymous said...

It cant be any better and neater than this !!!
Thanxxxx a bunch

Mumrik said...

Thank you very much!

Action Abbas said...

Thank you very much.

Anonymous said...

Thanks, very quick & effective, saved me time & trouble!

Anonymous said...

it worked...thanks...

Beagle Skywalker said...

Thank you for sharing!

I would like to know if is it posible hide the address toolbar?

Thanks again

SHAIKH FARHAN said...

Good work.....
How can we get string from Edittext and then allow go to the link.