aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 13e487735..c2088e559 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -206,10 +206,9 @@ public class ConversationActivity extends XmppActivity
}
String pending = savedInstanceState.getString(STATE_PENDING_URI, null);
if (pending != null) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onCreate() - restoring pending image uri");
mPendingImageUris.clear();
mPendingImageUris.add(Uri.parse(pending));
- mPendingPhotoUris.clear();
- mPendingPhotoUris.add(Uri.parse(pending));
}
}
@@ -1347,6 +1346,7 @@ public class ConversationActivity extends XmppActivity
}
savedInstanceState.putBoolean(STATE_PANEL_OPEN, isConversationsOverviewVisable());
if (this.mPendingImageUris.size() >= 1) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onSaveInstanceState() - saving pending image uri");
savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString());
} else if (this.mPendingPhotoUris.size() >= 1) {
savedInstanceState.putString(STATE_PENDING_URI, this.mPendingPhotoUris.get(0).toString());
@@ -1472,28 +1472,40 @@ public class ConversationActivity extends XmppActivity
this.onActivityResult(mPostponedActivityResult.first, RESULT_OK, mPostponedActivityResult.second);
}
+ final boolean stopping;
+ if (Build.VERSION.SDK_INT >= 17) {
+ stopping = isFinishing() || isDestroyed();
+ } else {
+ stopping = isFinishing();
+ }
+
if (!forbidProcessingPendings) {
int ImageUrisCount = mPendingImageUris.size();
if (ImageUrisCount == 1) {
Uri uri = mPendingImageUris.get(0);
+ Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching image to conversations. stopping="+Boolean.toString(stopping));
attachImageToConversation(getSelectedConversation(), uri);
} else {
for (Iterator<Uri> i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) {
Uri foo = i.next();
+ Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching images to conversations. stopping="+Boolean.toString(stopping));
attachImagesToConversation(getSelectedConversation(), foo);
}
}
for (Iterator<Uri> i = mPendingPhotoUris.iterator(); i.hasNext(); i.remove()) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching photo to conversations. stopping="+Boolean.toString(stopping));
attachPhotoToConversation(getSelectedConversation(), i.next());
}
for (Iterator<Uri> i = mPendingVideoUris.iterator(); i.hasNext(); i.remove()) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching video to conversations. stopping="+Boolean.toString(stopping));
attachVideoToConversation(getSelectedConversation(), i.next());
}
for (Iterator<Uri> i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) {
- attachFileToConversation(getSelectedConversation(), i.next());
+ Log.d(Config.LOGTAG,"ConversationsActivity.onBackendConnected() - attaching file to conversations. stopping="+Boolean.toString(stopping));
+ attachFileToConversation(getSelectedConversation(), i.next());
}
if (mPendingGeoUri != null) {
@@ -1619,9 +1631,11 @@ public class ConversationActivity extends XmppActivity
if (xmppConnectionServiceBound) {
if (ImageUrisCount == 1) {
Uri uri = mPendingImageUris.get(0);
+ Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE");
attachImageToConversation(getSelectedConversation(), uri);
} else {
for (Iterator<Uri> i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching images to conversations. CHOOSE_IMAGES");
attachImagesToConversation(getSelectedConversation(), i.next());
}
}
@@ -1636,6 +1650,7 @@ public class ConversationActivity extends XmppActivity
mPendingFileUris.addAll(uris);
if (xmppConnectionServiceBound) {
for (Iterator<Uri> i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching file to conversations. CHOOSE_FILE/RECORD_VOICE");
attachFileToConversation(c, i.next());
}
}
@@ -1658,6 +1673,7 @@ public class ConversationActivity extends XmppActivity
mPendingVideoUris.addAll(uris);
if (xmppConnectionServiceBound) {
for (Iterator<Uri> i = mPendingVideoUris.iterator(); i.hasNext(); i.remove()) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching video to conversations. CHOOSE_VIDEO");
attachVideoToConversation(c, i.next());
}
}
@@ -1674,7 +1690,8 @@ public class ConversationActivity extends XmppActivity
if (mPendingPhotoUris.size() == 1) {
Uri uri = mPendingPhotoUris.get(0);
if (xmppConnectionServiceBound) {
- attachPhotoToConversation(getSelectedConversation(), uri);
+ Log.d(Config.LOGTAG,"ConversationsActivity.onActivityResult() - attaching photo to conversations. TAKE_PHOTO");
+ attachPhotoToConversation(getSelectedConversation(), uri);
mPendingPhotoUris.clear();
}
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);