Long Click Event

2 posts, 0 answers
  1. jon
    jon avatar
    24 posts
    Member since:
    Jun 2009

    Posted 04 Nov Link to this post

    I'm trying to do a long press on a calendar day cell to push to another activity. So far, I have the long click working:

    RadCalendarView calendarControl;
    calendarControl.SetOnLongClickListener(new SelectedDateLongPress());
     
    class SelectedDateLongPress : Java.Lang.Object, RadCalendarView.IOnLongClickListener
            {
                public bool OnLongClick(View view)
                {
                    RadCalendarView cal = (RadCalendarView)view;
                    cal.OnSelectedDatesChangedListener = new SelectedDateChangedListener();
                    Alert_Handler.ShowErrorAlert("Long Press", "Long Press Alert", view.Context, ApplicationVariables.MainActivity);
     
                    return false;
                }
            }

     

    How do I get the new date on the cell pressed? This seems to fire before the selected date is changed

  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 09 Nov Link to this post

    Hello,

    The Long Click event is not actually implemented by RadCalendar and as such it is fired by the Android framework.

    In this particular scenario you could use a Boolean flag, raise it to true when the Long Click is called, and when the Selected Date Changed is fired by RadCalendarView - navigate to the new activity using the new selected date if the flag is raised.

    Let me know if you have additional questions.

    Regards,
    Deyan
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top