Restart activity in onNewIntent if activity is not yet initialized.
This commit is contained in:
parent
490944a02a
commit
0c535904fc
1 changed files with 16 additions and 0 deletions
|
@ -400,6 +400,8 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
private boolean isMmsEnabled = true;
|
private boolean isMmsEnabled = true;
|
||||||
private boolean isSecurityInitialized = false;
|
private boolean isSecurityInitialized = false;
|
||||||
|
|
||||||
|
private volatile boolean screenInitialized = false;
|
||||||
|
|
||||||
private IdentityRecordList identityRecords = new IdentityRecordList(Collections.emptyList());
|
private IdentityRecordList identityRecords = new IdentityRecordList(Collections.emptyList());
|
||||||
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
||||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||||
|
@ -449,6 +451,11 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
initializeSecurity(recipient.get().isRegistered(), isDefaultSms).addListener(new AssertedSuccessListener<Boolean>() {
|
initializeSecurity(recipient.get().isRegistered(), isDefaultSms).addListener(new AssertedSuccessListener<Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
|
if (isFinishing()) {
|
||||||
|
Log.w(TAG, "Activity is finishing. Not proceeding with initialization.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initializeProfiles();
|
initializeProfiles();
|
||||||
initializeGv1Migration();
|
initializeGv1Migration();
|
||||||
initializeDraft(args).addListener(new AssertedSuccessListener<Boolean>() {
|
initializeDraft(args).addListener(new AssertedSuccessListener<Boolean>() {
|
||||||
|
@ -469,6 +476,8 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
composeText.addTextChangedListener(typingTextWatcher);
|
composeText.addTextChangedListener(typingTextWatcher);
|
||||||
}
|
}
|
||||||
composeText.setSelection(composeText.length(), composeText.length());
|
composeText.setSelection(composeText.length(), composeText.length());
|
||||||
|
|
||||||
|
screenInitialized = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -486,6 +495,13 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!screenInitialized) {
|
||||||
|
Log.w(TAG, "Activity is in the middle of initialization. Restarting.");
|
||||||
|
finish();
|
||||||
|
startActivity(intent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
reactWithAnyEmojiStartPage = -1;
|
reactWithAnyEmojiStartPage = -1;
|
||||||
if (!Util.isEmpty(composeText) || attachmentManager.isAttachmentPresent() || inputPanel.getQuote().isPresent()) {
|
if (!Util.isEmpty(composeText) || attachmentManager.isAttachmentPresent() || inputPanel.getQuote().isPresent()) {
|
||||||
saveDraft();
|
saveDraft();
|
||||||
|
|
Loading…
Add table
Reference in a new issue