Reputation: 1
I want my Android app to open wikipedia.com as soon as the icon is pressed. I've set up everything correctly, it's just a programming problem. This is what I have so far in my src folder:
package com.wikipedia.lewicki;
import android.app.Activity;
import android.os.Bundle;
public class WikipediaMobile extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
I want to open the www.wikipedia.com home page.
Upvotes: 0
Views: 630
Reputation: 2609
You can open URL into your browser using:
String url="www.wikipedia.com"
Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(url));
startActivity(browserIntent);
Upvotes: 1