I\'ve got an async task that is supposed to show progress during a file upload. Everything is working except that it looks like it finishes the file upload really really fast,
You can try using a AsyncTask ...
create a progress dialog in onPreExecute method and dismiss the dialog in onPostExecute method..
Keep the upload method in doInBackground()
example :
public class ProgressTask extends AsyncTask {
public ProgressTask(ListActivity activity) {
this.activity = activity;
dialog = new ProgressDialog(context);
}
/** progress dialog to show user that the backup is processing. */
private ProgressDialog dialog;
protected void onPreExecute() {
this.dialog.setMessage("Progress start");
this.dialog.show();
}
@Override
protected void onPostExecute(final Boolean success) {
if (dialog.isShowing()) {
dialog.dismiss();
}
}
protected Boolean doInBackground(final String... args) {
// your upload code
return true;
}
}
}