リストビューにあるアイテムを他のアクティビティにリンクしたいので、リストビューアイテムをクリックすると他のアクティビティに移動できます。このリストビューのクリック可能なアイテムを他のアクティビティにリダイレクトするにはどうすればよいですか?
setListAdapter(new ArrayAdapter(this, android.R.layout.simple_expandable_list_item_1, Categories));
ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v,int position, long id) {
switch (position){
case 0: Intent animalsGridViewIntent = new Intent(ListOfAppGallery.this,AnimalsGridView.class);
ListOfAppGallery.this.startActivity(animalsGridViewIntent);
break;
case 1: Intent calenderGridViewIntent = new Intent(ListOfAppGallery.this,CalenderGridView.class);
ListOfAppGallery.this.startActivity(calenderGridViewIntent);
break;
case 2: Intent carsGridViewIntent = new Intent(ListOfAppGallery.this,CarsGridView.class);
ListOfAppGallery.this.startActivity(carsGridViewIntent);
break;
}
}
});
感謝をしたいに応じて位置を確認してください。 –
ようこそ... –