Show send dialog as fix for no public key

This commit is contained in:
M66B 2020-06-27 22:46:21 +02:00
parent a52e56afd8
commit 06359174c5
1 changed files with 12 additions and 6 deletions

View File

@ -2619,16 +2619,22 @@ public class FragmentCompose extends FragmentBase {
protected void onException(Bundle args, Throwable ex) { protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException) { if (ex instanceof IllegalArgumentException) {
Log.i(ex); Log.i(ex);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG); Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE);
if (ex.getCause() instanceof CertificateException) snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
snackbar.setAction(R.string.title_fix, new View.OnClickListener() { @Override
@Override public void onClick(View v) {
public void onClick(View v) { if (ex.getCause() instanceof CertificateException)
startActivity( startActivity(
new Intent(getContext(), ActivitySetup.class) new Intent(getContext(), ActivitySetup.class)
.putExtra("tab", "encryption")); .putExtra("tab", "encryption"));
else {
FragmentDialogSend fragment = new FragmentDialogSend();
fragment.setArguments(args);
fragment.setTargetFragment(FragmentCompose.this, REQUEST_SEND);
fragment.show(getParentFragmentManager(), "compose:send");
} }
}); }
});
snackbar.show(); snackbar.show();
} else } else
Log.unexpectedError(getParentFragmentManager(), ex); Log.unexpectedError(getParentFragmentManager(), ex);