listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
UserInfo userInfo=infos.get(position);
Intent intent=new Intent();
intent.putExtra("friendName", userInfo.getName());
intent.setClass(MainActivity.this,ChatActivity.class);
startActivity(intent);
}
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
UserInfo userInfo=infos.get(position);
Intent intent=new Intent();
intent.putExtra("friendName", userInfo.getName());
intent.setClass(MainActivity.this,ChatActivity.class);
startActivity(intent);
}
});
******************
@Override
public
void
onItemClick(AdapterView<?> parent, View v,
int
position,
long
id) {
doSomething(parent.getAdapter().getItem(position));
}