I am downloading a file from dropbox which is taking a few seconds. I want to add a ProgressDialog for the download but I don\'t know how to do that.
Use this simple code @sachin
public class DownloadFile extends AsyncTask {
Home home;
ProgressDialog dialog = null;
public DownloadFile(Home home) {
// TODO Auto-generated constructor stub
this.home = home;
}
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
//Call hare method for download
return null;
}
@Override
protected void onPostExecute(Void result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
dialog.dismiss();
}
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
dialog = ProgressDialog.show(home, "Downloading......", "", true);
}
}