我一直在开发一些Android应用程序,并且有以下代码:
final CalendarView calendarView=(CalendarView)layout.findViewById(R.id.calendarView);
calendarView.setClickable(true);
calendarView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Log.e("event", "click");
});
calendarView.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Log.e("event", "long click");
return false;
}
});
calendarView.setOnDateChangeListener(new OnDateChangeListener(){
@Override
public void onSelectedDayChange(CalendarView view, int year,
int month, int dayOfMonth) {
Log.e("event", "datachanged");
}
});
我需要捕捉“OnClick”事件,但我只捕捉“OnDataChange”事件。我不明白为什么。请帮我。先感谢您。