When i push a button in a 'AlertDialog' i need to go back to the previous Activity - How to do?

TroelsThistedTroelsThisted DKMember ✭✭
edited March 2016 in Xamarin.Android

I cant find a propper way to go back after pushing the a button in a AlertDialog, at the moment my code looks like this:

                AlertDialog.Builder alert = new AlertDialog.Builder(Activity);
                alert.SetTitle("Title");
                alert.SetMessage("Message above buttons!");
                alert.SetIcon(Resource.Drawable.ic_action_help);
                alert.SetPositiveButton("button title1", (senderAlert, args) =>
                {
                    Toast.MakeText(Activity, "toast title!", ToastLength.Short).Show();
                    mOrders.Clear();
                    WriteToOrder();

        // Here i want to go back to previous activity

                });
                alert.SetNegativeButton("button title2", (senderAlert, args) =>
                {
                    Toast.MakeText(Activity, "toast title!", ToastLength.Short).Show();

                });
                alert.Show();   

Hopefully some1 can help :)

Tagged:

Best Answer

Answers

Sign In or Register to comment.