How to properly show Android AlertDialog from any class?

In my game, the GameOver page allows users to submit their scores to the server.

I want to show an alert dialog if the submission is successful or not. Since the GameOver page belongs in a PCL in a separate project and does not inherit the GameActivity, what is the proper way to get the application Context and show the alert dialog from the GameOver


What I’ve done so far is to pass the GameActivity Context as parameter to any class that needs it

private Context context;
protected override void OnCreate(Bundle bundle)
        Game game = new SpaceShooterX.Game1 ();
        SetContentView ((View)game.Services.GetService (typeof(View)));
        context = this;
        MessageBoxHelper messageBoxHelper = new MessageBoxHelper (context);
        SpaceX.MessageBoxHelper.IMsgBoxHelper = messageBoxHelper;

The alertdialog was not shown. No error message. I placed a break point to confirm alert.Show() was called.

 public void ShowOK()

            AlertDialog.Builder alert = new AlertDialog.Builder (context);
            alert.SetTitle ("Hi, how are you");
            alert.SetPositiveButton ("Good", (senderAlert, args) => {
            } );

            alert.SetNegativeButton ("Not doing great", (senderAlert, args) => {    
            } );


What am I doing wrong?

Never mind. It was the logic in the my UpdateScreen(GameTime gameTime) method that was causing the problem.