예제 #1
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            var id = item.ItemId;

            // refresh
            if (id == Resource.Id.refresh_weather)
            {
                SetForecastInfo();

                return(true);
            }

            // settings
            if (id == Resource.Id.action_settings)
            {
                StartActivity(new Intent(Activity, typeof(SettingsActivity)));
                return(true);
            }

            // view location on the map
            if (id == Resource.Id.action_location)
            {
                Intents.StartMap(Activity);
                return(true);
            }

            return(base.OnOptionsItemSelected(item));
        }
예제 #2
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            var id = item.ItemId;

            if (id == Resource.Id.action_settings)
            {
                StartActivity(new Intent(Activity, typeof(SettingsActivity)));
                return(true);
            }

            if (id == Resource.Id.action_location)
            {
                Intents.StartMap(Activity);
                return(true);
            }

            return(base.OnOptionsItemSelected(item));
        }