views:

760

answers:

2

Hi guys,

I'm just wondering how to fire up an Intent to the phone's browser to Open an specific URL and display it.

Can someone please give a hint?

Is there also a way to pass coords directly to google maps to display?

greetz, poeschlorn

+3  A: 

The page at http://www.tutorialforandroid.com/2009/04/open-urlwebsite-from-android.html suggests

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

Have a look at the documentation of Intent.ACTION_VIEW.

aioobe
thanks a lot, it's exactly what I was looking for
poeschlorn
+1  A: 

The short version

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

should work as well...

Juri