Andorid
=======

I want to show progressdialog while doing renaming task. The dialog should appear after clicking rename button. However, the progress dialog appears after renaming function(loop) is ended. Here's my code

```
public void onRenameClicked(View v){
    ProgressTask task = new ProgressTask();
    task.execute();
    for(int i = 0; i < num_of_files; i++){
            rename(file[i]);
    }
}

```

and Here's innerclass to show dialog

```
class ProgressTask extends AsyncTask<Integer, Void, Void>{
    ProgressDialog pd = new ProgressDialog(MainActivity.this);
    @Override
    protected Void doInBackground(Integer... i) {
        for(int j = 0; j < item.size(); j++) {
            pd.setProgress(j);
            pd.setMessage((j) + "/" + item.size());
        }
        return null;
    }
    @Override
    protected void onPreExecute() {
        pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        pd.setTitle("변경중");
        pd.setMax(item.size());
        pd.show();
    }
}

```