Hi,
I have create a list view within a tab with a list of teams within it, I want to create a activity which when clich goes to another class, I want to do this with 20 items that will be in thisa list, code is below
public class ll2 extends ListActivity {
static final String[] teams = new String[] {"Accrington Stanley", "Aldershot", "Barnet", "Bradford City", "Burton Albion", "Bury", "Cheltenham Town", "Chesterfield", "Crewe Alexandra" };
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
final String[] TEAMS = getResources().getStringArray(R.array.twoteams_array);
setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, TEAMS));
ListView lv = getListView(); lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View view, int position, long id) { // When clicked, show a toast with the TextView text Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
Intent intent;
intent = new Intent().setClass(this, Bradford.class);
}
}); }
}
I have been messing around with intent but all the tutorials I tried do not mention intent in relation to making a clickable listview.
How can I achieve this