我有这个代码
private ListView event_list;
event_list = (ListView) open_event_list.findViewById(R.id.events_list);
loadList(cw.getDate());
“cw”是一个被点击的 CalendarView,取决于你点击的日期,会出现一个包含 ListView 的对话框......只需看下面的图片里面的 loadList() 方法是
Cursor c = dbHelper.retrieveAllEventsWhere(TABLE_NAME, cwdate);
sched_list = new ArrayList<Schedule>();
Schedule s;
c.moveToFirst();
while(!c.isAfterLast())
{
s = new Schedule();
s.setId(c.getInt(c.getColumnIndex("_id")));
s.setTitle(c.getString(c.getColumnIndex("title")));
s.setDescription(c.getString(c.getColumnIndex("desc")));
s.setTime(c.getLong(c.getColumnIndex("time")));
s.setType(c.getString(c.getColumnIndex("type")));
if(c.getInt(c.getColumnIndex("alarm")) == 1)
s.setAlarm(true);
else
s.setAlarm(false);
Log.d("dbcheck", s.toString());
sched_list.add(s);
c.moveToNext();
}
dbHelper.close();
Log.d("dbcheck", "==============================");
for(Schedule sc: sched_list)
{
Log.d("dbcheck", sc.toString());
}
ScheduleAdapter schedListAdapter = new ScheduleAdapter(this, R.layout.schedule_list_item, sched_list);
event_list.setAdapter(schedListAdapter);
event_list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View v, int arg2,
long arg3) {
TextView sched_id = (TextView) v.findViewById(R.id.sched_id);
Toast toast = Toast.makeText(ScheduleActivity.this, sched_id.getText().toString(), Toast.LENGTH_SHORT);
toast.show();
}
});
所以我的问题是,当我单击对话框内的 ListView 上的一个项目时,它什么也不做,我无法单击或者它不可单击,如图所示没有任何反应