title: alert dialog not showing
body: <p>I am showing my alert dialog in a separate thread and its not working for me. initially when I click </p>
  
  <p>register button for 3000ms I am showing a progress dialogue. and after that I want to show a alert box but its not working. How to solve this?  </p>
  
  <p>Thanks in advance...!</p>
  
  <pre><code> register.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {
  
  
  Log.v(TAG, "Trying to Login");
  
  
     showDialog(0);
     t = new Thread() {
      public void run() {
       showDialog(0);
       try {
          Thread.sleep(3000);
          removeDialog(0);
      } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
      }
     };
     t.start();
  
  
    try {
  
   some data sending to server
  
   Object responce=(Object)soapEnvelope.getResponse();
     temp=responce.toString();
     if(temp.equals("1")){
  
   temp = "The result is 1";
           }
  
        System.out.println("The result is  "+temp);
  
  
          new Thread()
            {
               public void run()
               {
                       try
                            {
  
              sleep(3000);
          } catch (InterruptedException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
             AlertDialog.Builder successfullyLogin = new Builder(Register.this);
              successfullyLogin.setCancelable(false);
              successfullyLogin.setMessage("Successfully Login !").show();
          //Toast.makeText(getBaseContext(), "Toast text", Toast.LENGTH_LONG).show();
                 }
            }; 
  
  
  
            } catch (Exception e) {
  
            e.printStackTrace();
             }
  
               }
  
               });
  
  
                 }
  
             @Override
              protected Dialog onCreateDialog(int id) {
               switch (id) {
                case 0: {
                 dialog = new ProgressDialog(this);
                dialog.setMessage("Please wait while connecting...");
               dialog.setIndeterminate(true);
               dialog.setCancelable(true);
  
             }
  
  
               return dialog;
                 }
  
              return null;
                   }
  </code></pre>