mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
fixing avatar selection when some gallery apps won't return any extras
but still succeed // FREEBIE
This commit is contained in:
parent
760c96171d
commit
e05bacd8c3
@ -127,7 +127,7 @@
|
|||||||
<string name="GroupCreateActivity_contacts_mms_exception">An unexpected error happened that has made group creation fail.</string>
|
<string name="GroupCreateActivity_contacts_mms_exception">An unexpected error happened that has made group creation fail.</string>
|
||||||
<string name="GroupCreateActivity_contacts_no_members">You need at least one person in your group!</string>
|
<string name="GroupCreateActivity_contacts_no_members">You need at least one person in your group!</string>
|
||||||
<string name="GroupCreateActivity_contacts_invalid_number">One of the members of your group has a number that can\'t be read correctly. Please fix or remove that contact and try again.</string>
|
<string name="GroupCreateActivity_contacts_invalid_number">One of the members of your group has a number that can\'t be read correctly. Please fix or remove that contact and try again.</string>
|
||||||
<string name="GroupCreateActivity_file_io_exception">File I/O error, couldn\'t create temporary image file</string>
|
<string name="GroupCreateActivity_file_io_exception">File I/O error, couldn\'t create a temporary image file.</string>
|
||||||
|
|
||||||
<!-- ImportFragment -->
|
<!-- ImportFragment -->
|
||||||
<string name="ImportFragment_import_system_sms_database">Import System SMS Database?</string>
|
<string name="ImportFragment_import_system_sms_database">Import System SMS Database?</string>
|
||||||
|
@ -238,6 +238,7 @@ public class GroupCreateActivity extends PassphraseRequiredSherlockFragmentActiv
|
|||||||
File f = new File(Environment.getExternalStorageDirectory(), TEMP_PHOTO_FILE);
|
File f = new File(Environment.getExternalStorageDirectory(), TEMP_PHOTO_FILE);
|
||||||
try {
|
try {
|
||||||
f.createNewFile();
|
f.createNewFile();
|
||||||
|
f.deleteOnExit();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "Error creating new temp file.", e);
|
Log.e(TAG, "Error creating new temp file.", e);
|
||||||
Toast.makeText(getApplicationContext(), R.string.GroupCreateActivity_file_io_exception, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), R.string.GroupCreateActivity_file_io_exception, Toast.LENGTH_SHORT).show();
|
||||||
@ -338,13 +339,13 @@ public class GroupCreateActivity extends PassphraseRequiredSherlockFragmentActiv
|
|||||||
break;
|
break;
|
||||||
case PICK_AVATAR:
|
case PICK_AVATAR:
|
||||||
if(resultCode == RESULT_OK) {
|
if(resultCode == RESULT_OK) {
|
||||||
Bundle extras = data.getExtras();
|
File tempFile = getTempFile();
|
||||||
if (extras != null) {
|
avatarBmp = BitmapFactory.decodeFile(tempFile.getAbsolutePath());
|
||||||
File tempFile = getTempFile();
|
if (avatarBmp != null) avatar.setImageBitmap(avatarBmp);
|
||||||
avatarBmp = BitmapFactory.decodeFile(tempFile.getAbsolutePath());
|
tempFile.delete();
|
||||||
avatar.setImageBitmap(avatarBmp);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "Avatar selection result was not RESULT_OK.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user