android - Progress Dialog and orientation changed -


I have some problems with the progress dialog. I use the managed progress dialog to show the user that An operation is being performed with the following code written in the onCreateDialog (int id) function:

  case PROGRESS_DIALOG: {dialog = new ProgressDialog () this); Dialog.setMessage (getResources () GetString (R.string.eStrUpdating)); Dialog.setCancelable (true); Dialog.setOnCancelListener (New DialogInterface.OnCancelListener) {Cancel on Public Zero (DialogInterface dialogInterface) {Log.i (tag, "cancel progress dialog");}}); Return dialog; }  

When the operation is complete, then I call Dismiss (PROGRESS_DIALOG). The problem is that if I rotate the phone when the progress dialog is displayed, then when the call is defective after the operation is complete, then there is no effect and progress is visible. And why can not I understand this

When you rotate the phone, the activity is destroyed and rebuilt. After this, you should reject the diasty system of your activity on your dialogue and recreate it.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -