Hi,

I've implemented a DateTimeListener event which compiles fine, but dies
when the emulator comes to run the code with the following error

Unhandled Exception

Java.Lang.IllegalArgumentException: (and then nothing, which doesn't
really help).

The code looks like this

    class DateChangedListener : Java.Lang.Object,
DatePicker.IOnDateChangedListener
    {
        Action<DatePicker, int, int, int> callback;
        public DateChangedListener(Action<DatePicker, int, int, int>
callback)
        {
            this.callback = callback;
        }

        public void OnDateChanged (DatePicker view, int year, int
monthOfYear, int dayOfMonth)
        {
            callback(view, year, monthOfYear, dayOfMonth);
        }
    }

with the call in the code looking like this

DateTime today = DateTime.Now;

            DatePicker dater =
FindViewById<DatePicker>(Resource.Id.dateDisplay);
            dater.Init(today.Year, today.Month, today.Day, new
DateChangedListener((DatePicker, year, month, day) => 
            {
                DateTime d = new DateTime(year, month, day);
                common.date = d;
            }));

Exception is thrown on the Init line.

Any advice on what is causing this error?

Thanks

Paul
-- 
Vertraue mir, ich weiss, was ich mache...

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to