Reputation: 17
I was developing an app log in page, and was trying to add a waiting page using an activity in dialog style, just like the picture. So, in the logging-in code, I set up a thread for connecting to network and validating the account, also set up a thread for starting the waiting page. But, if it validated successfully, how can the app destroy the waiting page and enter the main function activity? If it failed, how can the app destroy the waiting page and return to the log-in page?
Upvotes: 0
Views: 948
Reputation: 118
You can use a progress dialog for this purpose. If you are using Async Task then declare a dialog as:
ProgressDialog progressDialog;
And display it in "onPreExecute" procedure as:
progressDialog = ProgressDialog.show(Login.this, "Login",
"Please wait for a while.", true);
And, in "onPostExecute" procedure close the dialog after loggin in as:
progressDialog.dismiss();
Upvotes: 1