Пример #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 void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate(Resource.Menu.DetailMenu, menu);

            var menuItem = menu.FindItem(Resource.Id.action_share);

            var shareActionProvider = (ShareActionProvider)menuItem.ActionProvider;

            if (shareActionProvider != null)
            {
                shareActionProvider.SetShareIntent(Intents.CreateShareForecastIntent(_forecastString + " #SpringTimeApp"));
            }
            else
            {
                Log.Debug("SpringTime", "Share Action Provider is null?");
            }
        }
Пример #3
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));
        }