aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 1c69eb88d..135f6aef3 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -57,7 +57,7 @@ import de.pixart.messenger.utils.FileUtils;
import de.pixart.messenger.xmpp.pep.Avatar;
public class FileBackend {
- private final SimpleDateFormat fileDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmssSSS", Locale.US);
+ private static final SimpleDateFormat fileDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmssSSS", Locale.US);
private XmppConnectionService mXmppConnectionService;
@@ -462,7 +462,7 @@ public class FileBackend {
}
public Uri getTakePhotoUri() {
- File file = new File(getTakePhotoPath()+"IMG_" + this.fileDateFormat.format(new Date()) + ".jpg");
+ File file = new File(getTakePhotoPath()+"IMG_" + fileDateFormat.format(new Date()) + ".jpg");
file.getParentFile().mkdirs();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(mXmppConnectionService,"de.pixart.messenger.files",file);
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 845d174d5..cafd18f00 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -1688,14 +1688,15 @@ public class ConversationActivity extends XmppActivity
}
} else if (requestCode == ATTACHMENT_CHOICE_TAKE_PHOTO) {
if (mPendingPhotoUris.size() == 1) {
- Uri uri = mPendingPhotoUris.get(0);
- if (xmppConnectionServiceBound) {
+ Uri uri = FileBackend.getIndexableTakePhotoUri(mPendingPhotoUris.get(0));
+ mPendingPhotoUris.set(0, uri);
+ if (xmppConnectionServiceBound) {
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);
- intent.setData(FileBackend.getIndexableTakePhotoUri(uri));
+ intent.setData(uri);
sendBroadcast(intent);
} else {
mPendingPhotoUris.clear();