Tuesday, February 13, 2018

Android : How to Open Browser with Some Link

In Android, we can open browser with a given link.

For this you need an Intent  with ACTION_VIEW

You also need a permission "Internet".


Make sure you declare following permission to access Internet

<uses-permission android:name="android.permission.INTERNET" /> 

 Intent intent = new Intent(Intent.ACTION_VIEW);
                    
intentsetData(Uri.parse("http://www.learn-android-easily.coml"));
                    startActivity(
intent);



You you run, a chosser dialog will be opned with option of avialable browses.You can select any browser.


I hope you enjoyed the post.

Happy Android Development.

No comments:

Post a Comment