Can't Get it right using switch on listview i need help or some suggestion about how can i convert the string array values open another layout webview..
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class chapters extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] chapters = new String[] { "One", "Two",
"Three", "Four" };
this.setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, chapters));
}
@Override
protected void onListItemClick(ListView listchapter, View v, int position, long id){
super.onListItemClick(listchapter, v, position, id);
// Get the item that was clicked
Object o = this.getListAdapter().getItem(position);
String keyword = o.toString();
Toast.makeText(this, "You selected: " + keyword, Toast.LENGTH_LONG)
.show();
switch(position){
case 0:
}
}
}