title: Using timer with ProgressDialog
body: <p>I have a method which is list my items from a server. Therefore, this method takes time until getting all the items. So I want to use ProgressDialog for waiting this method. I read some modules but I couldnt find any useful solution. </p>
  
  <pre><code>    public void onCreate(Bundle savedInstanceState) 
          {
              super.onCreate(savedInstanceState);
              // setContentView(R.layout.main;
                      loginScreen();
          }
      public boolean getItems() throws MessagingException 
             {
                      items receiving here
             }
      public void loginScreen() 
             {
                     setContentView(R.layout.main);
                     Button loginBtn = (Button) findViewById(R.id.btnLogin);
  
                     loginBtn.setOnClickListener(new Button.OnClickListener() 
                       {          
                        public void onClick(View arg0) 
                         {
                            getItems();
                         }
                       }
             }
  </code></pre>
  
  <p>On button Click I call the method which received all items. When I click the button I want to show a progressbar until all items getting.</p>