Open a link in the browser

Put your problem here if it does not fit any of the other categories.

Open a link in the browser

Postby Ansem » Thu Mar 08, 2012 4:32 pm

Hy,i start some day ago to programming for android :)
I search a lot a method for open a link in the browser after a tap on a button.
Someone can tell me how can i do? :(
Ansem
Freshman
Freshman
 
Posts: 2
Joined: Thu Mar 08, 2012 4:23 pm

Top

Re: Open a link in the browser

Postby Phyll » Thu Mar 08, 2012 6:45 pm

Hi Ansem,

Do it like this:

Code: Select all
                Intent intent = new Intent();
                intent.setAction(android.content.Intent.ACTION_VIEW);
                intent.setData( Uri.parse("http://betterpaving.com/") );
                startActivity(intent);


Hope this helps.

Phyll
Phyll
Master Developer
Master Developer
 
Posts: 648
Joined: Fri Oct 14, 2011 11:19 am

Re: Open a link in the browser

Postby nuetronprotron » Fri Mar 09, 2012 5:00 am

Hi Ansem,
you can do it through intents by providing the data and actin to the intents.
nuetronprotron
Developer
Developer
 
Posts: 37
Joined: Tue Jan 10, 2012 10:22 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 16 guests