be more carefull with pending uris

This commit is contained in:
Daniel Gultsch 2015-12-05 19:02:57 +01:00
parent 6358f641e7
commit b7f326372d

View File

@ -998,6 +998,7 @@ public class ConversationActivity extends XmppActivity
if (xmppConnectionServiceBound) { if (xmppConnectionServiceBound) {
if (intent != null && VIEW_CONVERSATION.equals(intent.getType())) { if (intent != null && VIEW_CONVERSATION.equals(intent.getType())) {
handleViewConversationIntent(intent); handleViewConversationIntent(intent);
setIntent(new Intent());
} }
} else { } else {
setIntent(intent); setIntent(intent);
@ -1049,17 +1050,26 @@ public class ConversationActivity extends XmppActivity
public void onSaveInstanceState(final Bundle savedInstanceState) { public void onSaveInstanceState(final Bundle savedInstanceState) {
Conversation conversation = getSelectedConversation(); Conversation conversation = getSelectedConversation();
if (conversation != null) { if (conversation != null) {
savedInstanceState.putString(STATE_OPEN_CONVERSATION, savedInstanceState.putString(STATE_OPEN_CONVERSATION,conversation.getUuid());
conversation.getUuid()); } else {
savedInstanceState.remove(STATE_OPEN_CONVERSATION);
} }
savedInstanceState.putBoolean(STATE_PANEL_OPEN, savedInstanceState.putBoolean(STATE_PANEL_OPEN,isConversationsOverviewVisable());
isConversationsOverviewVisable());
if (this.mPendingImageUris.size() >= 1) { if (this.mPendingImageUris.size() >= 1) {
savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString()); savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString());
} else {
savedInstanceState.remove(STATE_PENDING_URI);
} }
super.onSaveInstanceState(savedInstanceState); super.onSaveInstanceState(savedInstanceState);
} }
private void clearPending() {
mPendingImageUris.clear();
mPendingFileUris.clear();
mPendingGeoUri = null;
mPostponedActivityResult = null;
}
@Override @Override
void onBackendConnected() { void onBackendConnected() {
this.xmppConnectionService.getNotificationService().setIsInForeground(true); this.xmppConnectionService.getNotificationService().setIsInForeground(true);
@ -1087,6 +1097,7 @@ public class ConversationActivity extends XmppActivity
finish(); finish();
} }
} else if (getIntent() != null && VIEW_CONVERSATION.equals(getIntent().getType())) { } else if (getIntent() != null && VIEW_CONVERSATION.equals(getIntent().getType())) {
clearPending();
handleViewConversationIntent(getIntent()); handleViewConversationIntent(getIntent());
} else if (selectConversationByUuid(mOpenConverstaion)) { } else if (selectConversationByUuid(mOpenConverstaion)) {
if (mPanelOpen) { if (mPanelOpen) {
@ -1100,11 +1111,8 @@ public class ConversationActivity extends XmppActivity
mOpenConverstaion = null; mOpenConverstaion = null;
} else if (getSelectedConversation() == null) { } else if (getSelectedConversation() == null) {
showConversationsOverview(); showConversationsOverview();
mPendingImageUris.clear(); clearPending();
mPendingFileUris.clear();
mPendingGeoUri = null;
setSelectedConversation(conversationList.get(0)); setSelectedConversation(conversationList.get(0));
mPostponedActivityResult = null;
this.mConversationFragment.reInit(getSelectedConversation()); this.mConversationFragment.reInit(getSelectedConversation());
} else { } else {
this.mConversationFragment.messageListAdapter.updatePreferences(); this.mConversationFragment.messageListAdapter.updatePreferences();