简体   繁体   中英

Copy/Paste menu items aren't shown on some devices in Android EditText

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:

在此处输入图像描述

On device (where it works):

在此处输入图像描述

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

在此处输入图像描述

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

Android has a default feature to show copy/paste menu

Try with this in your xml android:textIsSelectable .

ie, android:textIsSelectable="true"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM