public void openTimeDialog(int id, Bundle bundle)
        {
            FragmentTransaction ft = FragmentManager.BeginTransaction();
            //Remove fragment else it will crash as it is already added to backstack
            Fragment prev = FragmentManager.FindFragmentByTag("dialog");

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

            ft.AddToBackStack("time-dialog");
            // Create and show the dialog.


            //Add fragment

            Bundle taskdata = new Bundle();

            taskdata.PutInt("id", 3);
            taskdata.PutInt("hour", 3);
            taskdata.PutInt("minute", 7);
            Console.WriteLine("Opening new time dialog!");
            ReminderTimeDialog timeDialog = ReminderTimeDialog.NewInstance(taskdata);

            timeDialog.Arguments = taskdata;
            timeDialog.SetStyle(DialogFragmentStyle.NoTitle, 0);  //TODO: Create own theme and style
            timeDialog.Show(ft, "dialog");
            //ft.Commit();//added by winffee
        }
        public static ReminderTimeDialog NewInstance(Bundle bundle)
        {
            ReminderTimeDialog fragment = new ReminderTimeDialog();

            fragment.Arguments = bundle;
            return(fragment);
        }
        public void closeTimeDialog(ReminderTimeDialog dialog)
        {
            FragmentTransaction ft = FragmentManager.BeginTransaction();

            ft.Remove(dialog);
            ft.AddToBackStack("close-time");
            //ft.Commit();//added by winffee
            dialog.Dismiss();
            dateDialog.Dismiss();
            //Also tried i.e. dialog.Dismiss(); here
        }