title: Xamarin C# cannot convert c# class to Android.content.context
body: <p>i'm trying to test the DependencyService of my app by displaying an alert dialog from an android project when i press a button i created in the share code project.</p>
  
  <p>When i try to set the Context property in the 'AlertDialog.Builder' by entering 'this' in the parenthesis i get this error: "Cannot convert from 'CallDiverter2.Droid.CallDiverter_Android' to 'Android.Content.Context'.</p>
  
  <p>Also the namespace is decorated with: '[assembly: Dependency(typeof(CallDiverter_Android))]' if its matter.</p>
  
  <p>this is the function in the android project i want to call using the DependecyService: </p>
  
  <pre><code>public class CallDiverter_Android : ICallDiverter
  {
      public void DivertCall(string callForwardString)
      {
          //Divert call code
  
          //String callForwardString = "**21*1234567890#";
          //Intent callIntent = new Intent(Intent.ActionDial); // ACTION_CALL
          //Android.Net.Uri uri = Android.Net.Uri.Parse(callForwardString);
          //callIntent.SetData(uri);
          //Android.App.Application.Context.StartActivity(callIntent);
  
  
          AlertDialog.Builder dialog = new AlertDialog.Builder(this);
          AlertDialog alert = dialog.Create();
          alert.SetTitle("Title");
          alert.SetMessage("Simple Alert");
          alert.SetButton("OK", (s, ev) =&gt;
          {
              alert.SetMessage("This is an alert message");
          });
  
          alert.Show();
      }
  
      public void StopCallDiverting()
      {
          //Stop the call diverting action
      }
  }
  </code></pre>
  
  <p>How should i fix this so i can successfully test the dependencyService?</p>