mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 11:12:15 -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 {
|
public class CreateKeyEmailFragment extends Fragment {
|
||||||
private CreateKeyActivity mCreateKeyActivity;
|
private CreateKeyActivity mCreateKeyActivity;
|
||||||
private EmailEditText mEmailEdit;
|
private EmailEditText mEmailEdit;
|
||||||
private ArrayList<EmailAdapter.ViewModel> mAdditionalEmailModels;
|
private ArrayList<EmailAdapter.ViewModel> mAdditionalEmailModels = new ArrayList<>();
|
||||||
private EmailAdapter mEmailAdapter;
|
private EmailAdapter mEmailAdapter;
|
||||||
|
|
||||||
// NOTE: Do not use more complicated pattern like defined in android.util.Patterns.EMAIL_ADDRESS
|
// 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.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
emailsRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
emailsRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
|
||||||
// initial values
|
|
||||||
if (mAdditionalEmailModels == null) {
|
|
||||||
mAdditionalEmailModels = new ArrayList<>();
|
|
||||||
}
|
|
||||||
if (mEmailAdapter == null) {
|
if (mEmailAdapter == null) {
|
||||||
mEmailAdapter = new EmailAdapter(mAdditionalEmailModels, new View.OnClickListener() {
|
mEmailAdapter = new EmailAdapter(mAdditionalEmailModels, new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,12 +94,12 @@ public class ProgressDialogFragment extends DialogFragment {
|
|||||||
|
|
||||||
/** Updates progress of dialog */
|
/** Updates progress of dialog */
|
||||||
public void setProgress(String message, int progress, int max) {
|
public void setProgress(String message, int progress, int max) {
|
||||||
if (mIsCancelled) {
|
ProgressDialog dialog = (ProgressDialog) getDialog();
|
||||||
|
|
||||||
|
if (mIsCancelled || dialog == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressDialog dialog = (ProgressDialog) getDialog();
|
|
||||||
|
|
||||||
dialog.setMessage(message);
|
dialog.setMessage(message);
|
||||||
dialog.setProgress(progress);
|
dialog.setProgress(progress);
|
||||||
dialog.setMax(max);
|
dialog.setMax(max);
|
||||||
|
Loading…
Reference in New Issue
Block a user