mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-16 22:05:05 -05:00
Allow state loss on dismissal of progress dialogs, fixes #217
This commit is contained in:
parent
d8a91f15df
commit
34d791c9bd
@ -69,12 +69,12 @@ public class KeychainIntentServiceHandler extends Handler {
|
||||
|
||||
switch (message.arg1) {
|
||||
case MESSAGE_OKAY:
|
||||
mProgressDialogFragment.dismiss();
|
||||
mProgressDialogFragment.dismissAllowingStateLoss();
|
||||
|
||||
break;
|
||||
|
||||
case MESSAGE_EXCEPTION:
|
||||
mProgressDialogFragment.dismiss();
|
||||
mProgressDialogFragment.dismissAllowingStateLoss();
|
||||
|
||||
// show error from service
|
||||
if (data.containsKey(DATA_ERROR)) {
|
||||
|
@ -326,6 +326,22 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
||||
.BytesToPGPKeyRing(data
|
||||
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
||||
|
||||
addGeneratedKeyToView(newKeyRing);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Create a new Messenger for the communication back
|
||||
Messenger messenger = new Messenger(saveHandler);
|
||||
intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger);
|
||||
|
||||
mGeneratingDialog.show(mActivity.getSupportFragmentManager(), "dialog");
|
||||
|
||||
// start service with intent
|
||||
mActivity.startService(intent);
|
||||
}
|
||||
|
||||
private void addGeneratedKeyToView(PGPSecretKeyRing newKeyRing) {
|
||||
boolean isMasterKey = (mEditors.getChildCount() == 0);
|
||||
|
||||
// take only the key from this ring
|
||||
@ -349,16 +365,4 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
||||
mEditors.addView(view);
|
||||
SectionView.this.updateEditorsVisible();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// Create a new Messenger for the communication back
|
||||
Messenger messenger = new Messenger(saveHandler);
|
||||
intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger);
|
||||
|
||||
mGeneratingDialog.show(mActivity.getSupportFragmentManager(), "dialog");
|
||||
|
||||
// start service with intent
|
||||
mActivity.startService(intent);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user