title: Android Progress Bar not working for me
body: <p>Progress bar is not working for me. I am try to show some details in Progress. But I can't, What I did wrongly? Please help me.</p>
  
  <p>Activity Filename - MainActivity.java</p>
  
  <pre><code>package com.example.sqliteexample;
  
  import android.os.Bundle;
  import android.os.Handler;
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.view.Menu;
  
  public class MainActivity extends Activity {
  private Handler handler = new Handler();
  private ProgressDialog dialog;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      //dialog = ProgressDialog.show(this,getString(R.string.loading) ,getString(R.string.alignMsg));
      dialog = ProgressDialog.show(this,"Loading", "Loading the Image of the Day");
      Thread th = new Thread()
      {
          public void run() {
              handler.post(
                      new Runnable (){
                          @Override
                          public void run() {
                              try {
                                  Thread.sleep(10000);
                              } catch (InterruptedException e) {
                                  e.printStackTrace();
                              }
                              dialog.dismiss();
                          }});
          }};
          th.start();
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  </code></pre>
  
  <p>}</p>