大家好 我通过自定义适配器创建了自定义列表视图..
CustomAdapter adapter = new CustomAdapter(MainPage.this, dbHelper, imgId, title);
adapter.setList(list1);
list1.setAdapter(adapter);
list1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub
Log.i("hello",arg2+"item clicked ....");
Toast.makeText(MainPage.this, "Kindly enter search parameter!!", Toast.LENGTH_SHORT).show();
}
});
--
现在我无法选择任何项目。我不知道为什么.....
答案 0 :(得分:0)
尝试在适配器类getView()方法中设置膨胀视图“可点击”和“能够侦听点击事件”。
convertView = mInflater.inflate(R.layout.your_layout, null);
convertView.setClickable(true);