将数据放到intent对象中进行传递:
lvList = (ListView) findViewById(R.id.lv_list);
final ArrayList<HashMap<String, String>> contact= readContact();
lvList.setAdapter(new SimpleAdapter(this, contact, R.layout.contact_list_item, new String[]{"name","phone"},
new int[]{R.id.tv_name,R.id.tv_phone}));
lvList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// TODO Auto-generated method stub
String phone = contact.get(position).get("phone"); //读取当前的item的电话; 将这个值放到Intent中。
Intent intent = new Intent();
intent.putExtra("phone", phone); //将电话放到intent对象中;
setResult(1, intent); // 将数据传递到上一个页面。
finish(); //将页面关闭掉。
}
});