当ListView有Header时,onItemClick里的position不正确

@Override

public void onItemClick(AdapterView parent, View v, int position, long id) {

  // 获取真正的adapter

    doSomething(parent.getAdapter().getItem(position));

}

//设置head不可被点击

addHeaderView(View v, Object data, boolean isSelectable)

你可能感兴趣的:(当ListView有Header时,onItemClick里的position不正确)