title: Alert Dialog in non activity class
body: <p>I have a code which checks some data and shows an alert in a non activity class.  But while running application program crashed and does not showing alert dialog.  I used below code...</p>
  
  <pre><code>if( str.isEmpty() || strPort.isEmpty()){
          new AlertDialog.Builder(Mtx.getContext())
                      .setMessage("Please provide a valid String")
          .setTitle("HAT Alert !!!")
          .setCancelable(true)
          .setPositiveButton("OK", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int whichButton){
                  return;
              }
          }).show();
  </code></pre>
  
  <p>code for Mtx.getContent() method</p>
  
  <pre><code>public class Mtx extends Application {
  public static Context context;
  
  @Override
  public void onCreate(){
     super.onCreate();
     Mtx.context = getApplicationContext();
  }
  
  public static Context getContext(){
         return Mtx.context;
  }
  }
  </code></pre>
  
  <p>error message showing in log cat</p>
  
  <pre><code>10-15 12:50:33.708: E/global(329): Deprecated Thread methods are not supported.
  10-15 12:50:33.708: E/global(329): java.lang.UnsupportedOperationException
  10-15 12:50:33.708: E/global(329):  at java.lang.VMThread.stop(VMThread.java:85)
  10-15 12:50:33.708: E/global(329):  at java.lang.Thread.stop(Thread.java:1280)
  10-15 12:50:33.708: E/global(329):  at java.lang.Thread.stop(Thread.java:1247)
  10-15 12:50:33.708: E/global(329):  at mediatronix.HAT.Splash$1.run(Splash.java:36)
  </code></pre>
  
  <p>please correct me</p>
  
  <p>thanks</p>