Is it possible to get selection cursor on single click in a textview. By default, we get selection cursor when long click is performed. Selected text needs to appear in edittext below. I've tried using spannable string, so the tapped string comes in edittext, but i want the user to be able to modify the selection with selection cursor.

android:textIsSelectable works.
So the problem is that when you set the flag editable to false setKeyListener is called and the focusable flag is overwritten.
To fix it, in the onCreate of my activity You should add:
tesxtView.setKeyListener(null);
tesxtView.setFocusable(true);
try this:
yourTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ClipboardManager clipboard =
(ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setText(yourTextView.getText());
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With