From 8e6a4d1e14f55fb7ce41b252f9335a08e35de791 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:09:39 -0400 Subject: Fix app crashes after selecting capture image in UploadedImagesBottomSheetFragment --- .../docilealligator/infinityforreddit/activities/CommentActivity.java | 2 +- .../infinityforreddit/activities/EditCommentActivity.java | 2 +- .../docilealligator/infinityforreddit/activities/EditPostActivity.java | 2 +- .../infinityforreddit/activities/PostGalleryActivity.java | 2 +- .../docilealligator/infinityforreddit/activities/PostPollActivity.java | 2 +- .../docilealligator/infinityforreddit/activities/PostTextActivity.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java index 58f03537..3760b4cb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CommentActivity.java @@ -558,7 +558,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA public void captureImage() { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); try { - capturedImageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + capturedImageUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", File.createTempFile("captured_image", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri); startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java index c9dfc79e..1eadb47b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditCommentActivity.java @@ -371,7 +371,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab public void captureImage() { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); try { - capturedImageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + capturedImageUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", File.createTempFile("captured_image", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri); startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java index fb3e5261..7f668adc 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/EditPostActivity.java @@ -341,7 +341,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled public void captureImage() { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); try { - capturedImageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + capturedImageUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", File.createTempFile("captured_image", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri); startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java index bf82df4a..c949a737 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java @@ -472,7 +472,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee public void captureImage() { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); try { - imageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + imageUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", File.createTempFile("temp_img", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java index 813d1ec4..c3f6e508 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java @@ -734,7 +734,7 @@ public class PostPollActivity extends BaseActivity implements FlairBottomSheetFr public void captureImage() { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); try { - capturedImageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + capturedImageUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", File.createTempFile("captured_image", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri); startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java index 038076c5..81f41bd5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java @@ -711,7 +711,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr public void captureImage() { Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); try { - capturedImageUri = FileProvider.getUriForFile(this, "ml.docilealligator.infinityforreddit.provider", + capturedImageUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", File.createTempFile("captured_image", ".jpg", getExternalFilesDir(Environment.DIRECTORY_PICTURES))); pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri); startActivityForResult(pictureIntent, CAPTURE_IMAGE_REQUEST_CODE); -- cgit v1.2.3