我有以下的列表視圖Click事件中列表查看每個對象 - Android電子
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lv = (ListView) findViewById(R.id.liv1);
List<Room> livarray = new ArrayList<Room>();
livarray.add(new Room(R.drawable.room, "Meeting Room 1", "Small", "Yes"));
livarray.add(new Room(R.drawable.room, "IT Floor", "Large", "Yes"));
livarray.add(new Room(R.drawable.room, "Data Innovations Room", "Medium", "No"));
livarray.add(new Room(R.drawable.room, "Batman Room", "Large", "No"));
livarray.add(new Room(R.drawable.room, "Brainstorming Room", "Small", "No"));
livarray.add(new Room(R.drawable.room, "Room 1408", "Expanding", "No"));
ListView listViewRooms = (ListView) findViewById(R.id.liv1);
ListRoomsAdapter adapter = new ListRoomsAdapter(this, livarray);
listViewRooms.setAdapter(adapter);
}
我怎麼會對列表中的每個對象特定的onClick處理程序?
通過 「對象」 你的意思是一個ListItem?或物品內的任何東西? – theMfromA