AsyncTask publishProgress not updating my ProgressDialog
<p><strong>My actual task is getting completed however I am not getting any increase in the progress status of my progress bar even if i call the progress dialog..?can anyone say where I did wrong?</strong></p>

<pre><code>class A extends AsyncTask&lt;File[],Integer,Void&gt;
                {
                    private Context cnt;
                        int count=0;
                    @Override
                    protected void onPreExecute() {
                         pd = new ProgressDialog(cnt);
                            pd.setMessage("Matching progress");
                            pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
                            pd.setMax(100);
                            pd.setCancelable(false);
                            pd.setProgress(0);
                            pd.show();
                    }
                    A(Context context)
                    {
                        cnt=context;
                    }

                    protected Void doInBackground(File[]... params) {
                        // TODO Auto-generated method stub
                        File[] newfiles=params[0];
                        File[] temp=null;
                        int progress=0;
                        int dircnt=0;
                        int numberofdir=newfiles.length;
                        for(File b:newfiles)
                        {


                            count=0;
                            dirname=b.getName();
                            if(b.isDirectory())
                            {

                                temp=b.listFiles();
                            }
                            for(File a:temp)
                            {
                                gest=dotask.batchprocess(a.getPath());
                                if(gest!=null)
                                    System.out.println("success");
                                String name=dirname+"_"+count;
                                saveGesture(name, gest);
                                count++;

                            }
                            dircnt++;
                             progress=(int)((dircnt/numberofdir)*100);
                            publishProgress(progress);


                        }


                        return null;
                    }
                    @Override
                    protected void onProgressUpdate(Integer... values) {
                        // increment progress bar by progress value
                        pd.setProgress(values[0]);


                }
                     protected void onPostExecute() {
                        pd.hide();
                        pd=null;
                     }
    }
</code></pre>

<p><strong>below is the method from which I call the AsyncClass.</strong></p>

<pre><code> public void addgestures()
    {
                cView.postInvalidate();
                dotask.setH(cView.getH());
                dotask.setW(cView.getW());

                count=0;
                files=null;
                /*if(dir.isDirectory()) 
                {
                    files=dir.listFiles();
                }*/
                files=dir.listFiles();
                for(int i=0;i&lt;files.length;i++)
                {
                    System.out.println(files[i].getPath());
                }




                A a=new A(this);
                a.execute(files);



            }
</code></pre>
