title: Android Progress bar not showing up
body: <pre><code>private Handler handler = new Handler()
  {
      @Override
      public void handleMessage(Message msg)
      {
          removeDialog(0);
          switch (msg.what)
          {
              case SUCCESS:
                  Log.i("LoginActivity", "Got inputstream");
                  final InputStream is = (InputStream)msg.obj;
                  if (is != null)
                  {
                      //TODO: examine the input stream, etc...
                  }
                  break;
              case FAILURE:
                  Log.i("LoginActivity", "Login failed");
                  //TODO: Failure handling
                  break;
              default:
                  break;
          }
      }
  };
  
  @Override
  protected Dialog onCreateDialog(int id)
  {
      switch (id)
      {
          case 0:
          {
              dialog = new ProgressDialog(this);
              dialog.setMessage("Please wait...");
              dialog.setIndeterminate(true);
              dialog.setCancelable(true);
              return dialog;
          }
      }
      return null;
  }
  
  public void loginRequest(String name,String password)
  {   
      showDialog(0);
      loginThread thread = new loginThread(serverURL, name, password,getMyIMENumber(), handler);
      thread.start();
  }
  </code></pre>
  
  <p>...............</p>
  
  <pre><code>public class loginThread extends Thread {
  
  String name;
  String password;
  InputStream is;
  String Url;
  String ime;
  
  private final Handler handler;
  
     public loginThread(String Url,String name,String password,String ime,final Handler handler) {
         this.name = name;
         this.Url = Url;
         this.password = password;
         this.ime = ime;
         this.handler = handler;         
     }
  
  
     public void run() {
            try{
                    HttpClient httpClient = new DefaultHttpClient();
                    String loginURL = Url+"member/login";
                    HttpPost httppost = new HttpPost(loginURL);
                    HttpParams httpParameters = new BasicHttpParams();
                    List&lt;NameValuePair&gt; pairs = new ArrayList&lt;NameValuePair&gt;();
                    if(name.contentEquals(""))
                    {
                        pairs.add(new BasicNameValuePair("ime", ime));
                    }
                    else
                    {
                        pairs.add(new BasicNameValuePair("userName", name));
                        pairs.add(new BasicNameValuePair("password", password));                            
                    }                  
  
  
                    int timeoutConnection = 3000;
                    HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
                    // Set the default socket timeout (SO_TIMEOUT) 
                    // in milliseconds which is the timeout for waiting for data.
                    httppost.setEntity(new UrlEncodedFormEntity(pairs));
                    HttpResponse response = httpClient.execute(httppost);                           
                    HttpEntity entity = response.getEntity();
                    final InputStream is = entity.getContent();
  
                    Message message = new Message();
                    message.obj = is;
                    message.what = server.SUCCESS;
                    handler.sendMessage(message);
            }catch(Exception e){  
                Log.e("log_tag", "Error in http connection " + e.toString(), e);
                handler.sendEmptyMessage(server.FAILURE);
            }           
  
     }
  </code></pre>
  
  <p>}</p>
  
  <p>Progress dialog doesn't show up what am i doing wrong here!! please help me..</p>
  
  <p>......................</p>
  
  <p>// Compiled from DexFile.java (version 1.5 : 49.0, super bit)
  public final class dalvik.system.DexFile {</p>
  
  <p>// Method descriptor #8 (Ljava/io/File;)V
    // Stack: 3, Locals: 2
    public DexFile(java.io.File file) throws java.io.IOException;
       0  aload_0 [this]
       1  invokespecial java.lang.Object() [1]
       4  new java.lang.RuntimeException [2]
       7  dup
       8  ldc  [3]
      10  invokespecial java.lang.RuntimeException(java.lang.String) [4]
      13  athrow
        Line numbers:
          [pc: 0, line: 4]
        Local variable table:
          [pc: 0, pc: 14] local: this index: 0 type: dalvik.system.DexFile
          [pc: 0, pc: 14] local: file index: 1 type: java.io.File</p>
  
  <p>// Method descriptor #18 (Ljava/lang/String;)V
    // Stack: 3, Locals: 2
    public DexFile(java.lang.String fileName) throws java.io.IOException;
       0  aload_0 [this]
       1  invokespecial java.lang.Object() [1]
       4  new java.lang.RuntimeException [2]
       7  dup
       8  ldc  [3]
      10  invokespecial java.lang.RuntimeException(java.lang.String) [4]
      13  athrow
        Line numbers:
          [pc: 0, line: 5]
        Local variable table:
          [pc: 0, pc: 14] local: this index: 0 type: dalvik.system.DexFile
          [pc: 0, pc: 14] local: fileName index: 1 type: java.lang.String</p>
  
  <p>// Method descriptor #22 (Ljava/lang/String;Ljava/lang/String;I)Ldalvik/system/DexFile;
    // Stack: 3, Locals: 3
    public static dalvik.system.DexFile loadDex(java.lang.String sourcePathName, java.lang.String outputPathName, int flags) throws java.io.IOException;
       0  new java.lang.RuntimeException [2]
       3  dup
       4  ldc  [3]
       6  invokespecial java.lang.RuntimeException(java.lang.String) [4]
       9  athrow
        Line numbers:
          [pc: 0, line: 6]
        Local variable table:
          [pc: 0, pc: 10] local: sourcePathName index: 0 type: java.lang.String
          [pc: 0, pc: 10] local: outputPathName index: 1 type: java.lang.String
          [pc: 0, pc: 10] local: flags index: 2 type: int</p>
  
  <p>// Method descriptor #28 ()Ljava/lang/String;
    // Stack: 3, Locals: 1
    public java.lang.String getName();
       0  new java.lang.RuntimeException [2]
       3  dup
       4  ldc  [3]
       6  invokespecial java.lang.RuntimeException(java.lang.String) [4]
       9  athrow
        Line numbers:
          [pc: 0, line: 7]
        Local variable table:
          [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile</p>
  
  <p>// Method descriptor #30 ()V
    // Stack: 3, Locals: 1
    public void close() throws java.io.IOException;
       0  new java.lang.RuntimeException [2]
       3  dup
       4  ldc  [3]
       6  invokespecial java.lang.RuntimeException(java.lang.String) [4]
       9  athrow
        Line numbers:
          [pc: 0, line: 8]
        Local variable table:
          [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile</p>
  
  <p>// Method descriptor #32 (Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class;
    // Stack: 3, Locals: 3
    public java.lang.Class loadClass(java.lang.String name, java.lang.ClassLoader loader);
       0  new java.lang.RuntimeException [2]
       3  dup
       4  ldc  [3]
       6  invokespecial java.lang.RuntimeException(java.lang.String) [4]
       9  athrow
        Line numbers:
          [pc: 0, line: 9]
        Local variable table:
          [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile
          [pc: 0, pc: 10] local: name index: 1 type: java.lang.String
          [pc: 0, pc: 10] local: loader index: 2 type: java.lang.ClassLoader</p>
  
  <p>// Method descriptor #37 ()Ljava/util/Enumeration;
    // Signature: ()Ljava/util/Enumeration;
    // Stack: 3, Locals: 1
    public java.util.Enumeration entries();
       0  new java.lang.RuntimeException [2]
       3  dup
       4  ldc  [3]
       6  invokespecial java.lang.RuntimeException(java.lang.String) [4]
       9  athrow
        Line numbers:
          [pc: 0, line: 10]
        Local variable table:
          [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile</p>
  
  <p>// Method descriptor #30 ()V
    // Stack: 3, Locals: 1
    protected void finalize() throws java.io.IOException;
       0  new java.lang.RuntimeException [2]
       3  dup
       4  ldc  [3]
       6  invokespecial java.lang.RuntimeException(java.lang.String) [4]
       9  athrow
        Line numbers:
          [pc: 0, line: 11]
        Local variable table:
          [pc: 0, pc: 10] local: this index: 0 type: dalvik.system.DexFile</p>
  
  <p>// Method descriptor #42 (Ljava/lang/String;)Z
    public static native boolean isDexOptNeeded(java.lang.String arg0) throws java.io.FileNotFoundException, java.io.IOException;
  }</p>