Thursday, May 13, 2010

HOWTO: Open a webpage programmatically in an android java application

Using an intent like this:

Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("http://www.codeark.com"));

try {
 this.startActivity(intent);
} catch (ActivityNotFoundException ex) {
 // do something about the exception, or not ...
}


"this" is the Context.

more info here: Context.startActivity()

No comments:

Post a Comment