protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.EventMainLayout);
            firstEventbtn = FindViewById<Button> (Resource.Id.btnFirstEvent);
            firstEventbtn.Click += FirstEventbtn_Click;

            Button back = FindViewById<Button> (Resource.Id.btnEventMainBack);
            back.Click += Back_Click;

            nEventListView = FindViewById<ListView> (Resource.Id.lvEvent);

            nEvents = new List<Event>();

            EventDB dbr = new EventDB ();
            var result = dbr.CreateDB ();
            nCount = dbr.getEventTotal ();

            //Building the event table
            if (nCount != 0) {
                for (int i = 1; i <= nCount; i++) {
                    var nextEvent = dbr.GetEventById (i);
                    nEvents.Add (new Event (nextEvent.title, nextEvent.date));
                }
            }
            EventListViewAdapter adapter = new EventListViewAdapter (this, nEvents);

            nEventListView.Adapter = adapter;
            nEventListView.ItemClick += NEventListView_ItemClick;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.EventUpdateLayout);

            timeDisplay = FindViewById<TextView> (Resource.Id.txtTime);
            //pick_button = FindViewById<Button> (Resource.Id.btnUpdateTime);

            // Add a click listener to the button
            pick_button.Click += (o, e) => ShowDialog (TIME_DIALOG_ID);

            // Get the current time
            hour = DateTime.Now.Hour;
            minute = DateTime.Now.Minute;

            dateDisplay = FindViewById<TextView> (Resource.Id.txtDate);
            //pickDate = FindViewById<Button> (Resource.Id.btnUpdateDate);

            // add a click event handler to the button
            pickDate.Click += delegate { ShowDialog (DATE_DIALOG_ID); };

            // get the current date
            date = DateTime.Today;

            // Display the current date/time
            UpdateDisplay ();

            updateTitle = FindViewById <EditText>(Resource.Id.txtTitle);
            updateLocation = FindViewById<EditText> (Resource.Id.txtLocation);
            update = FindViewById <Button>(Resource.Id.btnUpdate);
            update.Click += Update_Click;
            back = FindViewById<Button> (Resource.Id.btnUpdateBack);
            back.Click += Back_Click;
            update.SetText(Resource.String.UpdateEvent);

            EventDB dbr = new EventDB ();
            nCount = dbr.getEventTotal ();
            if (nCount != 0)
            {
                SetFields ((GEventID.getEventId () ));
            }
        }