protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Reservation);
            // Create your application here

            _mContext = Android.App.Application.Context;
            _ap       = new AppPreferences(_mContext);
            _userId   = _ap.getUserIdKey();

            ReservationService reservationService = new ReservationService();

            _reservationListView            = FindViewById <ListView>(Resource.Id.reservationLv);
            _reservationListView.ChoiceMode = ChoiceMode.Single;
            _reservationListView.Adapter    = new ReservationAdapter(this, reservationService.GetReservations());

            RegisterForContextMenu(_reservationListView);
            _reservationListView.ItemClick += _reservationListView_ItemClick;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _mContext = Android.App.Application.Context;
            _ap       = new AppPreferences(_mContext);
            _userId   = _ap.getUserIdKey();

            if (string.IsNullOrEmpty(_userId))
            {
                Console.WriteLine("please login");
                StartActivity(typeof(LoginActivity));
            }



            Button launchBtn = FindViewById <Button>(Resource.Id.launchButton);

            launchBtn.Click += delegate
            {
                LaunchNotification("sample notif", "something happened");
            };

            Button reservationBtn = FindViewById <Button>(Resource.Id.reservationBtn);

            reservationBtn.Click += ReservationBtn_Click;

            Button mapBtn = FindViewById <Button>(Resource.Id.mapBtn);

            mapBtn.Click += MapBtn_Click;

            Button logoutBtn = FindViewById <Button>(Resource.Id.logoutBtn);

            logoutBtn.Click += LogoutBtn_Click;

            //Timer
        }
Example #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Map);
            // Create your application here



            //layMapAction = FindViewById<LinearLayout>(Resource.Id.layMapAction);
            //layDescription = FindViewById<LinearLayout>(Resource.Id.layDescription);

            _mContext = Android.App.Application.Context;
            _ap       = new AppPreferences(_mContext);
            _userId   = Convert.ToInt32(_ap.getUserIdKey());

            InitializeLocationManager();
            //if (_currentLocation == null)
            //{
            //    Toast.MakeText(this.ApplicationContext, "Can't determine the current address. Try again in a few minutes.", ToastLength.Short).Show();
            //}
            SetUpMap();
        }