I want to show ProgressDialog when I click on Login button and it takes time to move to another page. How can I do this?
when you call in oncreate()
new LoginAsyncTask ().execute();
Here how to use in flow..
ProgressDialog progressDialog;
private class LoginAsyncTask extends AsyncTask {
@Override
protected void onPreExecute() {
progressDialog= new ProgressDialog(MainActivity.this);
progressDialog.setMessage("Please wait...");
progressDialog.show();
super.onPreExecute();
}
protected Void doInBackground(Void... args) {
// Parsse response data
return null;
}
protected void onPostExecute(Void result) {
if (progressDialog.isShowing())
progressDialog.dismiss();
//move activity
super.onPostExecute(result);
}
}