Merge pull request #3580 from wb9688/fix-email

Fix sending e-mail from crash reporter
This commit is contained in:
Tobias Groza 2020-05-13 17:10:22 +02:00 committed by GitHub
commit 87c7ac3970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,12 +229,15 @@ public class ErrorActivity extends AppCompatActivity {
context.startActivity(webIntent); context.startActivity(webIntent);
}) })
.setPositiveButton(R.string.accept, (dialog, which) -> { .setPositiveButton(R.string.accept, (dialog, which) -> {
Intent i = new Intent(Intent.ACTION_SENDTO); final Intent i = new Intent(Intent.ACTION_SENDTO)
i.setData(Uri.parse("mailto:" + ERROR_EMAIL_ADDRESS)) .setData(Uri.parse("mailto:")) // only email apps should handle this
.putExtra(Intent.EXTRA_EMAIL, new String[]{ERROR_EMAIL_ADDRESS})
.putExtra(Intent.EXTRA_SUBJECT, ERROR_EMAIL_SUBJECT) .putExtra(Intent.EXTRA_SUBJECT, ERROR_EMAIL_SUBJECT)
.putExtra(Intent.EXTRA_TEXT, buildJson()); .putExtra(Intent.EXTRA_TEXT, buildJson());
if (i.resolveActivity(getPackageManager()) != null) {
startActivity(i);
}
startActivity(Intent.createChooser(i, "Send Email"));
}) })
.setNegativeButton(R.string.decline, (dialog, which) -> { .setNegativeButton(R.string.decline, (dialog, which) -> {
// do nothing // do nothing