1

I have a subclass of Android EditText and it' declared as:

    ...
    android:id="@+id/Main.editor"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="left|top"
    android:inputType="textMultiLine|textNoSuggestions|textVisiblePassword"
    android:imeOptions="flagNoExtractUi"
    ...

On most devices user are able to do a long click and see a menu with Copy/Paste items:

In emulator:

enter image description here

On device (where it works):

enter image description here

However on some devices it's not shown on long click:

enter image description here

What can be a reason? I'm thinking about declaring android:longClickable="true" explicitly but i believe it's a default value.

UPDATE: It's reproducible on some Android 9 devices, so it seems to be not that issue: https://issuetracker.google.com/issues/65575880

4ntoine
  • 19,816
  • 21
  • 96
  • 220
  • have you solved the issue? I also have a similar issue https://stackoverflow.com/questions/67777875/android-edit-text-there-is-no-paste-option could you please help, if you have solved it already? – Deepak Goyal Jun 07 '21 at 17:27
  • Do you still encounter the same issue recently? – Cheok Yan Cheng Mar 21 '23 at 08:29

1 Answers1

0

Android has a default feature to show copy/paste menu

Try with this in your xml android:textIsSelectable.

i.e., android:textIsSelectable="true"

Mehul Kabaria
  • 6,404
  • 4
  • 25
  • 50
  • are there any reasons to do it explicitly? Originally `textIsSelectable` relates to `TextView` which does not have selectable behaviour in contrast to `EditText` – 4ntoine Jun 14 '20 at 07:47
  • using the `android:textIsSelectable="true"` on `EditText` will not open the Keyboard on clicking on `EditText`. – Deepak Goyal Jun 07 '21 at 17:22