mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-13 20:35:10 -05:00
Fixing rotate crashes in create key
This commit is contained in:
parent
e4b7920edc
commit
a35594201a
@ -48,7 +48,7 @@ import java.util.regex.Pattern;
|
||||
public class CreateKeyEmailFragment extends Fragment {
|
||||
private CreateKeyActivity mCreateKeyActivity;
|
||||
private EmailEditText mEmailEdit;
|
||||
private ArrayList<EmailAdapter.ViewModel> mAdditionalEmailModels;
|
||||
private ArrayList<EmailAdapter.ViewModel> mAdditionalEmailModels = new ArrayList<>();
|
||||
private EmailAdapter mEmailAdapter;
|
||||
|
||||
// NOTE: Do not use more complicated pattern like defined in android.util.Patterns.EMAIL_ADDRESS
|
||||
@ -119,10 +119,6 @@ public class CreateKeyEmailFragment extends Fragment {
|
||||
emailsRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
emailsRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||
|
||||
// initial values
|
||||
if (mAdditionalEmailModels == null) {
|
||||
mAdditionalEmailModels = new ArrayList<>();
|
||||
}
|
||||
if (mEmailAdapter == null) {
|
||||
mEmailAdapter = new EmailAdapter(mAdditionalEmailModels, new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -94,12 +94,12 @@ public class ProgressDialogFragment extends DialogFragment {
|
||||
|
||||
/** Updates progress of dialog */
|
||||
public void setProgress(String message, int progress, int max) {
|
||||
if (mIsCancelled) {
|
||||
return;
|
||||
}
|
||||
|
||||
ProgressDialog dialog = (ProgressDialog) getDialog();
|
||||
|
||||
if (mIsCancelled || dialog == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
dialog.setMessage(message);
|
||||
dialog.setProgress(progress);
|
||||
dialog.setMax(max);
|
||||
|
Loading…
Reference in New Issue
Block a user