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

Method onActionItemClicked

app/src/main/java/eu/faircode/email/Helper.java:2794–2820  ·  view source on GitHub ↗
(ActionMode mode, MenuItem item)

Source from the content-addressed store, hash-verified

2792 }
2793
2794 @Override
2795 public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
2796 if (item.getGroupId() == Menu.CATEGORY_SECONDARY)
2797 try {
2798 int id = item.getItemId();
2799 if (id == R.string.title_insert_contact) {
2800 String email = getSelected();
2801 String name = UriHelper.getEmailUser(email);
2802
2803 Intent insert = new Intent();
2804 insert.putExtra(ContactsContract.Intents.Insert.EMAIL, email);
2805 if (!TextUtils.isEmpty(name))
2806 insert.putExtra(ContactsContract.Intents.Insert.NAME, name);
2807 insert.setAction(Intent.ACTION_INSERT);
2808 insert.setType(ContactsContract.Contacts.CONTENT_TYPE);
2809 view.getContext().startActivity(insert);
2810 } else if (id == R.string.title_select_block) {
2811 Pair<Integer, Integer> block = StyleHelper.getParagraph(view, true);
2812 if (block != null)
2813 android.text.Selection.setSelection((Spannable) view.getText(), block.first, block.second);
2814 return true;
2815 }
2816 } catch (Throwable ex) {
2817 Log.e(ex);
2818 }
2819 return false;
2820 }
2821
2822 @Override
2823 public void onDestroyActionMode(ActionMode mode) {

Callers

nothing calls this directly

Calls 11

getSelectedMethod · 0.95
getEmailUserMethod · 0.95
getParagraphMethod · 0.95
eMethod · 0.95
setActionMethod · 0.80
setTypeMethod · 0.80
getItemIdMethod · 0.45
isEmptyMethod · 0.45
startActivityMethod · 0.45
setSelectionMethod · 0.45
getTextMethod · 0.45

Tested by

no test coverage detected