Exemple #1
0
        private void Add()
        {
            try
            {
                ProblemSolvingDialogFragment problemFragment = null;

                problemFragment = new ProblemSolvingDialogFragment(this, "Add Problem", -1);
                Log.Info(TAG, "Add_Click: New problem, passing ID -1 to dialog fragment");

                var fragmentTransaction = FragmentManager.BeginTransaction();
                if (fragmentTransaction != null)
                {
                    Log.Info(TAG, "Add_Click: Showing dialog Fragment");
                    problemFragment.Show(fragmentTransaction, problemFragment.Tag);
                }
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "Add: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorProblemSolvingActivityAdd), "ProblemSolvingActivity.Add");
                }
            }
        }
Exemple #2
0
        private void ProblemList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            Problem problem = null;
            ProblemSolvingDialogFragment problemFragment = null;

            problem         = GlobalData.ProblemSolvingItems[e.Position];
            problemFragment = new ProblemSolvingDialogFragment(this, "Edit Problem", problem.ProblemID);
            Log.Info(TAG, "Add_Click: Existing problem detected with ID " + problem.ProblemID.ToString());
            var fragmentTransaction = FragmentManager.BeginTransaction();

            if (fragmentTransaction != null)
            {
                Log.Info(TAG, "Add_Click: Showing dialog Fragment");
                problemFragment.Show(fragmentTransaction, problemFragment.Tag);
            }
        }