I have declared a simple ProgressDialog in my android application but it isn’t showing up. Here is my instantiation:
ProgressDialog pDialog = new ProgressDialog(MyActivity.this, ProgressDialog.STYLE_SPINNER);
pDialog.setMessage("Logging in...");
pDialog.show();
I am pretty new to Android development but not Java; does anybody see anything that I might be doing wrong?
UPDATE
It’s weird, in the block that is supposed to dismiss the dialog, I have a content view switch, and if I comment out the dismissal the dialog will actually show AFTER the content switch. Here is said block:
if(writeSuccess){
Toast.makeText(getApplicationContext(), "Login Success!", Toast.LENGTH_SHORT).show();
pDialog.dismiss();
setContentView(R.layout.auth);
}
It should be like this.
By this single line also you will have a ProgressDialog.