title: Set Progress of Dialog
body: <p>I have a Async Task that does not add the percentage while it is going through the task. It always stays at 0% 0/100</p>
  
  <p>Here is my code</p>
  
  <pre><code>     private class getAppInfo extends AsyncTask&lt;String, String, String&gt; {
      /** The system calls this to perform work in a worker thread and
        * delivers it the parameters given to AsyncTask.execute() */
      ProgressDialog dialog;
  
      @Override
      protected void onPreExecute() {
          if(showLoading == true){
               dialog = new ProgressDialog(SelfHelp.this);
               dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
               dialog.setMessage("Loading");
               dialog.setIndeterminate(true);
               dialog.setCancelable(false);   
               dialog.setMax(100);
               dialog.setProgress(100);
               dialog.show();
          }
      }
  
      @Override
      protected String doInBackground(String... urls) {                       
          String xml = null;
          int count = 0;
          try {
              // defaultHttpClient
              DefaultHttpClient httpClient = new DefaultHttpClient();
              HttpGet httpGet = new HttpGet(urls[0]);
  
              HttpResponse httpResponse = httpClient.execute(httpGet);
              HttpEntity httpEntity = httpResponse.getEntity();
              xml = EntityUtils.toString(httpEntity);
  
              while(count != 100){
                  publishProgress(""+count);
                  count += 5;
              }
  
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }                                
  
          Document doc = parser.GetDomElement(xml);
          NodeList nl = doc.getElementsByTagName("topic");
          getChildElements(nl);                           
          return xml;
      }
  
  
      @Override
      protected void onProgressUpdate(String... progress) {
          Log.v("count",progress[0]);
          dialog.setProgress(Integer.parseInt(progress[0]));
     }
  
      /** The system calls this to perform work in the UI thread and delivers
        * the result from doInBackground() */
      @Override
      protected void onPostExecute(String result) {    
          //dialog.setProgress(100);
          menuList.setAdapter(setListItems(menuItems));
          menuList.setTextFilterEnabled(true);
          if(showLoading == true){
              dialog.dismiss();
              showLoading = false;
          }
      }
  </code></pre>
  
  <p>It does go into <code>onProgressUpdate</code> and the count goes up by 5 but the progress bar does not change. How can I have it increment by 5 and show the progress properly?</p>