Beispiel #1
0
        void ShowDialog()
        {
            // Create the fragment and show it as a dialog.
            var newFragment = new MyDialogFragment();

            newFragment.Show(SupportFragmentManager, "dialog");
        }
        void ShowDialog()
        {
            // Create the fragment and show it as a dialog.
            DialogFragment newFragment = MyDialogFragment.NewInstance();

            newFragment.Show(GetSupportFragmentManager(), "dialog");
        }
Beispiel #3
0
            public static MyDialogFragment NewInstance(String title)
            {
                MyDialogFragment frag = new MyDialogFragment();
                Bundle           args = new Bundle();

                args.PutString("text", title);
                frag.Arguments = args;
                return(frag);
            }
Beispiel #4
0
            /**
             * Create a new instance of MyDialogFragment, providing "num"
             * as an argument.
             */
            internal static MyDialogFragment NewInstance(int num)
            {
                MyDialogFragment f = new MyDialogFragment();

                // Supply num input as an argument.
                Bundle args = new Bundle();

                args.PutInt("num", num);
                f.SetArguments(args);

                return(f);
            }
Beispiel #5
0
        void ShowDialog(String text)
        {
            // DialogFragment.show() will take care of adding the fragment
            // in a transaction.  We also want to remove any currently showing
            // dialog, so make our own transaction and take care of that here.
            FragmentTransaction ft = FragmentManager.BeginTransaction();

            DialogFragment newFragment = MyDialogFragment.NewInstance(text);

            // Show the dialog.
            newFragment.Show(ft, "dialog");
        }
		void ShowDialog() 
		{
	        stackLevel++;
	
	        // DialogFragment.show() will take care of adding the fragment
	        // in a transaction.  We also want to remove any currently showing
	        // dialog, so make our own transaction and take care of that here.
	        var ft = SupportFragmentManager.BeginTransaction();
	        var prev = SupportFragmentManager.FindFragmentByTag("dialog");
	        if (prev != null) {
	            ft.Remove(prev);
	        }
	        ft.AddToBackStack(null);
	
	        // Create and show the dialog.
	        var newFragment = new MyDialogFragment(stackLevel);
	        newFragment.Show(ft, "dialog");
    	}
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layouts.fragment_dialog_or_activity);

            if (savedInstanceState == null)
            {
                // First-time init; create fragment to embed in activity.

                FragmentTransaction ft          = GetSupportFragmentManager().BeginTransaction();
                DialogFragment      newFragment = MyDialogFragment.NewInstance();
                ft.Add(R.Ids.embedded, newFragment);
                ft.Commit();
            }

            // Watch for button clicks.
            Button button = (Button)FindViewById(R.Ids.show_dialog);

            button.Click += (x, y) => ShowDialog();
        }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
		
			SetContentView(Resource.Layout.fragment_dialog_or_activity);
			
			if(bundle == null)
			{
				// First-time init; create fragment to embed in activity.
				var ft = SupportFragmentManager.BeginTransaction();
				var newFragment = new MyDialogFragment();
				ft.Add(Resource.Id.embedded, newFragment);
				ft.Commit();
			}
			
			var button = FindViewById<Button>(Resource.Id.show_dialog);
			button.Click += (sender, e) => {
				ShowDialog();
			};
		}
Beispiel #9
0
        void ShowDialog()
        {
            mStackLevel++;

            // DialogFragment.Show() will take care of Adding the fragment
            // in a transaction.  We also want to remove any currently showing
            // dialog, so make our own transaction and take care of that here.
            FragmentTransaction ft   = GetSupportFragmentManager().BeginTransaction();
            Fragment            prev = GetSupportFragmentManager().FindFragmentByTag("dialog");

            if (prev != null)
            {
                ft.Remove(prev);
            }
            ft.AddToBackStack(null);

            // Create and show the dialog.
            DialogFragment newFragment = MyDialogFragment.NewInstance(mStackLevel);

            newFragment.Show(ft, "dialog");
        }
Beispiel #10
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.fragment_dialog_or_activity);

            if (bundle == null)
            {
                // First-time init; create fragment to embed in activity.
                var ft          = SupportFragmentManager.BeginTransaction();
                var newFragment = new MyDialogFragment();
                ft.Add(Resource.Id.embedded, newFragment);
                ft.Commit();
            }

            var button = FindViewById <Button>(Resource.Id.show_dialog);

            button.Click += (sender, e) => {
                ShowDialog();
            };
        }
        void ShowDialog()
        {
            stackLevel++;

            // DialogFragment.show() will take care of adding the fragment
            // in a transaction.  We also want to remove any currently showing
            // dialog, so make our own transaction and take care of that here.
            var ft   = SupportFragmentManager.BeginTransaction();
            var prev = SupportFragmentManager.FindFragmentByTag("dialog");

            if (prev != null)
            {
                ft.Remove(prev);
            }
            ft.AddToBackStack(null);

            // Create and show the dialog.
            var newFragment = new MyDialogFragment(stackLevel);

            newFragment.Show(ft, "dialog");
        }
		void ShowDialog() {
	        // Create the fragment and show it as a dialog.
	        var newFragment = new MyDialogFragment();
	        newFragment.Show(SupportFragmentManager, "dialog");
	    }
            /**
             * Create a new instance of MyDialogFragment, providing "num"
             * as an argument.
             */
            internal static MyDialogFragment NewInstance(int num) {
                MyDialogFragment f = new MyDialogFragment();

                // Supply num input as an argument.
                Bundle args = new Bundle();
                args.PutInt("num", num);
                f.SetArguments(args);

                return f;
            }
Beispiel #14
0
        public static MyDialogFragment newInstance()
        {
            MyDialogFragment f = new MyDialogFragment();

            return(f);
        }
 public static MyDialogFragment NewInstance(String title)
 {
     MyDialogFragment frag = new MyDialogFragment ();
     Bundle args = new Bundle ();
     args.PutString ("text", title);
     frag.Arguments = args;
     return frag;
 }