MCPcopy Create free account
hub / github.com/M66B/FairEmail / onSave

Method onSave

app/src/main/java/eu/faircode/email/ActivityEML.java:468–484  ·  view source on GitHub ↗
(MessageHelper.AttachmentPart apart)

Source from the content-addressed store, hash-verified

466 }
467
468 @Override
469 public void onSave(MessageHelper.AttachmentPart apart) {
470 ActivityEML.this.apart = apart;
471
472 Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);
473 create.addCategory(Intent.CATEGORY_OPENABLE);
474 create.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
475 create.setType(apart.attachment.getMimeType());
476 if (!TextUtils.isEmpty(apart.attachment.name))
477 create.putExtra(Intent.EXTRA_TITLE, apart.attachment.name);
478 Helper.openAdvanced(ActivityEML.this, create);
479 if (create.resolveActivity(getPackageManager()) == null) // system whitelisted
480 Log.unexpectedError(getSupportFragmentManager(),
481 new IllegalArgumentException(getString(R.string.title_no_saf)), 25);
482 else
483 startActivityForResult(Helper.getChooser(ActivityEML.this, create), REQUEST_ATTACHMENT);
484 }
485 });
486 rvAttachment.setAdapter(adapter);
487

Callers 1

onActivityResultMethod · 0.95

Calls 11

openAdvancedMethod · 0.95
unexpectedErrorMethod · 0.95
getChooserMethod · 0.95
setTypeMethod · 0.80
getMimeTypeMethod · 0.45
isEmptyMethod · 0.45
getStringMethod · 0.45
getDataMethod · 0.45
getIntentMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected