Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

open a url on click of ok button in android

I have to open a URL on Click of OK Button in a view. Can someone tell how to do this?

like image 704
User Avatar asked Feb 08 '11 06:02

User


People also ask

How to open URL on click of button Android?

On Button click event write this: Uri uri = Uri. parse("http://www.google.com"); // missing 'http://' will cause crashed Intent intent = new Intent(Intent. ACTION_VIEW, uri); startActivity(intent);


1 Answers

On Button click event write this:

Uri uri = Uri.parse("http://www.google.com"); // missing 'http://' will cause crashed Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); 

that open the your URL.

like image 81
Parag Chauhan Avatar answered Nov 15 '22 13:11

Parag Chauhan