//定交一个listview
ListView lv=(ListView)findViewById(R.id.ListView01);
//数据源绑定
SimpleAdapter adp = new SimpleAdapter(this,
list, R.layout.main_list,
new String[]{"OrderType","Orderdate","Price","OrderState","Id"},
new int[]{R.id.tvTitle,R.id.tvDate,R.id.tvPrice,R.id.tvState,R.id.tvId});
//显示数据
lv.setAdapter(adp);
//item点事件
lv.setOnItemClickListener(new ListView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> arg0, View arg1, int arg2,long arg3) {
Intent intent = new Intent(OrderActivity.this,DaiActivity.class);//OrderActivity.this,当前页面,DaiActivity.class转至的页面
//item内的数据保存在map中
Map
//需要的数据在intent中
intent.putExtra("id", map.get("Id"));
//跳转页面
OrderActivity.this.startActivity(intent);
}
});
另一个页面
Intent intent = getIntent();
String id = intent.getStringExtra("id");