fix opening avatar-preview, getBaseContext() is not needed and led to crashes on some android versions as this context might not be an Activity

This commit is contained in:
B. Petersen
2020-06-06 16:49:09 +02:00
parent 8b196c9372
commit 1afd2faa4a
@@ -401,12 +401,11 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
profileImagePath = dcContext.getContact(contactId).getProfileImage();
profileImageUri = Uri.fromFile(new File(profileImagePath));
Context ctx = getBaseContext();
String type = "image/" + profileImagePath.substring(profileImagePath.lastIndexOf(".") +1);
Intent intent = new Intent(ctx, MediaPreviewActivity.class);
intent.setDataAndType(profileImageUri, type);
ctx.startActivity(intent);
Intent intent = new Intent(this, MediaPreviewActivity.class);
intent.setDataAndType(profileImageUri, type);
startActivity(intent);
}
public void onEditName() {