Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow paste into empty EditText?

Paste suggestion popup doesn't appear when I longclick on empty EditText (OK with non-empty).

XML

<EditText
    android:layout_width="0dp"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:gravity="right"
    android:textSize="50sp"
    android:inputType="numberDecimal"
    android:id="@+id/text"/>

Code which touches EditText

editText.setRawInputType(InputType.TYPE_NULL);
if (Build.VERSION.SDK_INT >= 11) {
    editText.setTextIsSelectable(true);
} else {
    editText.setFocusable(true);
}
like image 787
aikrikunov95 Avatar asked Nov 10 '22 08:11

aikrikunov95


1 Answers

Did you try to copy data first? I just tried it on my own application, and without doing anything I have the collapse dialog which appears after I have copied something. If I have nothing copied, I don't have the popup (which is normal).

like image 172
leb1755 Avatar answered Dec 08 '22 18:12

leb1755