title: Stop startActivity(intent) when going in catch block from another class
body: <p>I am developing an Android Xamarin appliation in which I have an activity with a button. Some of the code in the button is this:</p>
  
  <pre><code>fsp_SellDet_New_ByItemID fsp_SellDet_New_ByItemID = new fsp_SellDet_New_ByItemID(this);
              fsp_SellDet_New_ByItemID.ExecuteNonQuery(_SellID,
                                                       _ItemID,
                                                       _PodID,
                                                       _ItemSellQty,
                                                       _ItemPrice,
                                                       _ItemPricePer,
                                                       -_BaseDiscount,
                                                       -_AdditionalDiscount,
                                                       _ItemSum,
                                                       _ItemVAT,
                                                       _ItemCode,
                                                       _ItemShortName,
                                                       _ItemBrand,
                                                       _ItemIssue);
              Intent i = new Intent(this, typeof(SellDet));
              StartActivity(i);
              Finish();
  </code></pre>
  
  <p>My problem is that inside the ExecuteNonQuery method I have handled exceptions in a try and a catch block like so:</p>
  
  <pre><code>catch (Exception ex)
          {
              _dlgAlert = new AlertDialog.Builder(this).Create();
              _dlgAlert.SetMessage(ex.Message);
              _dlgAlert.SetTitle(Resources.GetString(Resource.String.Error));
              _dlgAlert.SetButton("OK", delegate { });
              _dlgAlert.Show();
              return;
          }
  </code></pre>
  
  <p>Even tho I am using "return;", Android still opens the next activity so I cannot really see what the exception was, since by the time the AlertDialog shows up, the next activty is already opened.</p>
  
  <p>Can you give me some advices on how to make it so if I receive an exception in the ExecuteNonQuery method, an AlertDialog will popup and it won't go in the next activty. </p>
  
  <p>Or maybe can you tell me how to make it, so that you will have to press "OK" on the alertDialog and then it will go in the activty. Remember, the AlertDialog is inside the executeNonQuery method in the newly created class, not in the button method..</p>
  
  <p>Thank you in advance</p>