This is a migrated thread and some comments may be shown as answers.

Long Click Event

1 Answer 138 Views
Calendar - Xamarin.Android
This is a migrated thread and some comments may be shown as answers.
jon
Top achievements
Rank 1
jon asked on 04 Nov 2016, 05:40 PM

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

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 09 Nov 2016, 02:05 PM
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
Tags
Calendar - Xamarin.Android
Asked by
jon
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or