I wanted to show a ProgressDialog when data need to be uploaded to the server.
I have checked this question Best way to show a loading/progress indicator? the best answer was
ProgressDialog progress = new ProgressDialog(this);
progress.setTitle("Loading");
progress.setMessage("Wait while loading...");
progress.show();
// To dismiss the dialog
progress.dismiss();
when i tried to implement this in my code, nothing showed at all !! what is that i am doing wrong here?!
this is my code
private void UpdateData()
{
ProgressDialog progress = new ProgressDialog(this);
progress.setTitle("Loading");
progress.setMessage("Wait while loading...");
progress.show();
try
{
UpdateWSTask updateWSTask = new UpdateWSTask();
String Resp = updateWSTask.execute().get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
progress.dismiss();
}