Display error when camera doesn't return image

Partial #6926
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-09-06 16:03:08 -07:00
parent e172b84603
commit 967c374213
2 changed files with 4 additions and 1 deletions

View File

@ -238,6 +238,7 @@
<string name="CreateProfileActivity_updating_and_encrypting_profile">Updating and encrypting profile</string> <string name="CreateProfileActivity_updating_and_encrypting_profile">Updating and encrypting profile</string>
<string name="CreateProfileActivity_profile_photo">Profile photo</string> <string name="CreateProfileActivity_profile_photo">Profile photo</string>
<string name="CreateProfileActivity_too_long">Too long</string> <string name="CreateProfileActivity_too_long">Too long</string>
<string name="CreateProfileActivity_error_capturing_photo_camera_did_not_return_image">Error capturing photo, camera did not return image</string>
<!-- CustomDefaultPreference --> <!-- CustomDefaultPreference -->
<string name="CustomDefaultPreference_using_custom">Using custom: %s</string> <string name="CustomDefaultPreference_using_custom">Using custom: %s</string>

View File

@ -119,7 +119,9 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje
switch (requestCode) { switch (requestCode) {
case REQUEST_CODE_AVATAR: case REQUEST_CODE_AVATAR:
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK && data == null) {
Toast.makeText(this, R.string.CreateProfileActivity_error_capturing_photo_camera_did_not_return_image, Toast.LENGTH_LONG).show();
} else if (resultCode == Activity.RESULT_OK) {
Uri outputFile = Uri.fromFile(new File(getCacheDir(), "cropped")); Uri outputFile = Uri.fromFile(new File(getCacheDir(), "cropped"));
Uri inputFile = data.getData(); Uri inputFile = data.getData();