监听代码:
lvSearch.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> adapter, View view, int position,
long id) {
LinearLayout ll = (LinearLayout) adapter.getChildAt(position);
TextView tx = (TextView) ll.getChildAt(0);
TextView tx1 = (TextView) ll.getChildAt(1);
Log.i("abcValues", tx.getText().toString());
我有一段NullPointerException
时间访问 a 的项目值ListView
。它适用于启动项目值,但不适用于滚动后出现的项目。