Progress dialog causes appication not responding error?
<p>Hi i am showing my upload progress using a <code>ProgressDialog</code> in an <code>AsycTask</code> but if the upload speed is less and the bar moves taking some time and my application shows application not responding error i.e wait or force close ..bt actually my work is going on and if i choose wait the application runs file..what should i do to remove this appication not responding error,or can i increase the time in till so that it doe's show so fast?</p>

<p>in the <code>doInBackground</code>  method</p>

<pre><code>.
.
.
.
.
.


    int i;          
                    byte[] buf = new byte[512];

                    while ((i = in.read(buf)) != -1) {                  
                        out.write(buf,0,i);
                        publishProgress(in.available());
                        System.out.println(i);
                    }
</code></pre>

<p>and int the progress upgrade method</p>

<pre><code>protected void onProgressUpdate(Integer... values) {
            // TODO Auto-generated method stub
            super.onProgressUpdate(values); 
            if(a==0){
                progressDialog.show();
            }
            a++;
            int b=(int) (fil.length()-values[0]);           
            progressDialog.setProgress(b);

        }
</code></pre>
