title: Android how to pass an Activity.class as an argument for a function
body: <p>I recently moved to Android from Python and am stuck here.</p>
  <p>This is my class declaration to create a common function for an Alert Dialog which accepts necessary parameters:</p>
  <pre><code>public static AlertDialog.Builder getAlertDialog(String strArray[],
          String strTitle, Activity v) {
  
      return new AlertDialog.Builder(v)
      .setTitle(strTitle).setItems(strArray,
              new DialogInterface.OnClickListener() {
  
          @Override
          public void onClick(DialogInterface dialog, int which) {
              // TODO Auto-generated method stub
          }
      });
  }
  </code></pre>
  <p>But I cannot call this function via this piece of code which gives me an error:</p>
  <pre><code>  getAlertDialog(strArray, strTitle, MakeCall.class).show();
  </code></pre>
  <p>The error is:</p>
  <pre><code>the method getAlertDialog(String[], String, Activity) in the type   MakeCallAlertDialog is not applicable for the arguments (String[], String, Class&lt;TestActivity&gt;)
  </code></pre>
  <p>How can I get this correctly?</p>