public static SortActivityDialogFragment NewInstance(int itemPosition)
        {
            var args = new Bundle(1);

            args.PutInt(ArgItemPosition, itemPosition);

            var f = new SortActivityDialogFragment();

            f.Arguments = args;
            return(f);
        }
예제 #2
0
        /// <Docs>The menu item that was selected.</Docs>
        /// <returns>To be added.</returns>
        /// <para tool="javadoc-to-mdoc">This hook is called whenever an item in your options menu is selected.
        ///  The default implementation simply returns false to have the normal
        ///  processing happen (calling the item's Runnable or sending a message to
        ///  its Handler as appropriate). You can use this method for any items
        ///  for which you would like to do processing without those other
        ///  facilities.</para>
        /// <summary>
        /// Raises the options item selected event.
        /// </summary>
        /// <param name="item">Item.</param>
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.action_new_activity:
            {
                var dialog = new AddActivityDialogFragment();
                dialog.Show(this);
            }
                return(true);

            case Resource.Id.action_sort:
            {
                int positin = PreferenceManager.GetDefaultSharedPreferences(Activity)
                              .GetInt(PrefsSortItemPosition, 0);
                var dialog = SortActivityDialogFragment.NewInstance(positin);
                dialog.Show(this);
            }
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }