aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-12-05 19:02:57 +0100
committerDaniel Gultsch <daniel@gultsch.de>2015-12-05 19:02:57 +0100
commitb7f326372d6ea2aceb40e36f18d9eaaba23fa97e (patch)
treeffcb2c2d904c016f56f19d45ca7e9f1ff10f76b9 /src
parent6358f641e7acbc5b02a3b7a46289dd4baed63fcf (diff)
be more carefull with pending uris
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 1f6e57a0a..969838bd8 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -998,6 +998,7 @@ public class ConversationActivity extends XmppActivity
if (xmppConnectionServiceBound) {
if (intent != null && VIEW_CONVERSATION.equals(intent.getType())) {
handleViewConversationIntent(intent);
+ setIntent(new Intent());
}
} else {
setIntent(intent);
@@ -1049,17 +1050,26 @@ public class ConversationActivity extends XmppActivity
public void onSaveInstanceState(final Bundle savedInstanceState) {
Conversation conversation = getSelectedConversation();
if (conversation != null) {
- savedInstanceState.putString(STATE_OPEN_CONVERSATION,
- conversation.getUuid());
+ savedInstanceState.putString(STATE_OPEN_CONVERSATION,conversation.getUuid());
+ } else {
+ savedInstanceState.remove(STATE_OPEN_CONVERSATION);
}
- savedInstanceState.putBoolean(STATE_PANEL_OPEN,
- isConversationsOverviewVisable());
+ savedInstanceState.putBoolean(STATE_PANEL_OPEN,isConversationsOverviewVisable());
if (this.mPendingImageUris.size() >= 1) {
savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString());
+ } else {
+ savedInstanceState.remove(STATE_PENDING_URI);
}
super.onSaveInstanceState(savedInstanceState);
}
+ private void clearPending() {
+ mPendingImageUris.clear();
+ mPendingFileUris.clear();
+ mPendingGeoUri = null;
+ mPostponedActivityResult = null;
+ }
+
@Override
void onBackendConnected() {
this.xmppConnectionService.getNotificationService().setIsInForeground(true);
@@ -1087,6 +1097,7 @@ public class ConversationActivity extends XmppActivity
finish();
}
} else if (getIntent() != null && VIEW_CONVERSATION.equals(getIntent().getType())) {
+ clearPending();
handleViewConversationIntent(getIntent());
} else if (selectConversationByUuid(mOpenConverstaion)) {
if (mPanelOpen) {
@@ -1100,11 +1111,8 @@ public class ConversationActivity extends XmppActivity
mOpenConverstaion = null;
} else if (getSelectedConversation() == null) {
showConversationsOverview();
- mPendingImageUris.clear();
- mPendingFileUris.clear();
- mPendingGeoUri = null;
+ clearPending();
setSelectedConversation(conversationList.get(0));
- mPostponedActivityResult = null;
this.mConversationFragment.reInit(getSelectedConversation());
} else {
this.mConversationFragment.messageListAdapter.updatePreferences();