I have a custom ListView adapter which contains 2 Textviews for each item , On long click on the item I want to have the option to copy the text from 1 of these Textviews to the clipboard, the question is how can i get this Textview's text?
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()) {
case R.id.copy:
Toast.makeText(getActivity(),"Text copied to clipboard.", Toast.LENGTH_SHORT).show();
//HOW CAN I GET THE TEXT?
mode.finish();
return true;
case R.id.share:
return false;
default:
return false;
}
}