I have a ProgressDialog:
ProgressDialog pDialog = ProgressDialog.show(MyActivity.this, "", "Logging In...");
And it is supposed to run from the top of the method and through until it reaches an end. Here is the block that is execute on authorization success:
if(writeSuccess){
Toast.makeText(getApplicationContext(), "Login Success!", Toast.LENGTH_SHORT).show();
pDialog.dismiss();
setContentView(R.layout.auth);
}
But the ProgressDialog will not fire. But if I comment out it’s dismissal it will fire after the ContentView has been switched. Anybody have any idea or remedy to this problem?
Use an ASyncTask to do what you want. On onPreExecute, create and display the dialog, on doInBackground, make your Login, and on onPostExecute dismiss the dialog previously created.