title: Starting activity from static method
body: <p>I've a problem with starting Activity's. I'm trying to start a new activity whithin a static method. </p>
  
  <p>This is my code for that:</p>
  
  <pre><code>    static Dialog dialog=null;
  public static void NextLevel(Context c,String title,String message){
  
  
       AlertDialog.Builder alertbox = new AlertDialog.Builder(c);
       alertbox.setTitle(title);
       alertbox.setMessage(message);
       alertbox.setPositiveButton("Volgende level", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface arg0, int arg1) {
  
           }
       });
       alertbox.setNegativeButton("Terug naar menu", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface arg0, int arg1) {
               startActivity(new Intent(Main.this, MainMenu.class));
           } 
       });
       alertbox.show();
  }
  </code></pre>
  
  <p>The startActivity doesn't work because it can't start an Activity from a static method. I just can't seem to figure out a way to solve this problem because I also can't create a context myself with which it could start it.</p>