i have a ListView that simly shows items on it.
I want to load a webpage e.g; google.com , when i click an item of the list view.
how can i do this? plz explain with a code sample.
i m new to android.
here is my list view code:
package com.androidListActivity;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MyList extends ListActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
String[] names = new String[]
{
"One",
"Two"
};
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.rowlayout, names));
}
protected void onListItemClick(ListView l, View v, int position, long id)
{
super.onListItemClick(l,v,position,id);
}
}
Plz edit this for example.
Thanks in advance
WebViewPage.java
webviewpage.xml
And finally add permission in Manifest file