我在这段代码中有问题。我需要执行中的代码,listView.setOnItemClickListener()
但程序没有进入这个函数。
有任何想法吗?
adapter = new CustomerListAdapter(Activity.this);
ListView listView = (ListView) findViewById(R.id.listView1);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Intent intent = new Intent(Activity.this, DetailActivity.class);
intent.putExtra("sk", adapter.getSK(position));
Activity.this.startActivityForResult(intent, REQUEST_DETAIL);
}
});