Tuesday, January 29, 2013

Opening a webpage In Browser


We can open a Web Page with Given URL in Android.  To do this start an Activity passing the URL of the WebPage as data.

Make sure you declare following permission to access Internet

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

 Intent i = new Intent(Intent.ACTION_VIEW);
                    i.setData(Uri.parse("http://www.indianrail.gov.in/pnr_Enq.html"));
                    startActivity(i);





1 comment: