What would be the best way to use a progress dialog in the following circumstance..
//start progress dialog here.
RequestInfoFormServer();
ProcessThatInfo();
return;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be using, if you’re not already using, an
AsyncTaskto do all the long running tasks in the background.You can also use a service to handle all of your Internet stuff if you plan to do a lot of Internet actions.
1) Construct a
Progress Dialogwithstudy this constructor and the methods for more customization
For a better UX, if you set the dialog to be cancell-able, then you should also be canceling the network activity if the dialog box is cancelled.
2) Create an
AsyncTask. in itsonPreExecute()method, use the following to display the progress dialog:3) In
doInBackground(), do all of your web stuff:4) Then in
onPostExecute()– do all the stuff that’s to be done on the UI
– close the progress dialog box with
progressDialog.cancel()if you don’t have to show the same dialog box again.Revert if you jump into any other issue.