I have used ProgressDialog in Android application.
I have a login, password and Loginbtn in a main form, when i login, i move to next screen, the login is on the bases of internet and webdomain, means upon login it sends request to online server having php file, which returns true or false, and it then moves to next screen. I want to use ProcessDialog unless it obtains true or false from server, and if it gets false the wheel should stop processing and it should show the message that invalid username or password, and if it gets true, after getting true it should end the process dialog and move to the next screen, right now ProcessDialog is working but when we click, i just start dialog to work, and then automatically intent moves to the next screen, but if we press back button, it still shows process dialog rotating. i just want to use processDialog in a correct way.
My code is
//start
progressDialog = new ProgressDialog(DomainDownManagerActivity.this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("Loading...");
progressDialog.show();
progressDialog.setProgress(100);
> if (v==true){
//v has true
Intent intent = new Intent(DomainDownManagerActivity.this,MainPanelActivity.class);
startActivity(intent);
}
else{
//set label of invalid user or pass
}
Image attached

1 Answer