CalendarView Clickable Android

前端 未结 3 1857
日久生厌
日久生厌 2020-12-15 14:02

I am trying to start a new activity when you click on a date in CalendarView but my event doesn\'t seem to fire. I have set clickable to true and specified an onclick (both

3条回答
  •  悲哀的现实
    2020-12-15 14:39

    OnGlobalLayoutListener will do the trick if you want to click already selected date.

    calendarView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
                @Override
                public void onGlobalLayout()
                {
                //your code here
                }
            });
    

提交回复
热议问题