Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Enable Default Copy paste on EditText

I define Edittext inside xml layout but when i select text inside EditText default cut copy paste not appeare.

here my xml code

<EditText
    android:id="@+id/xEt"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:ems="10"
    android:gravity="top"
    android:padding="15dp"
    android:singleLine="false"
    android:visibility="visible" /> 

my java code is:

    mEt = (EditText) findViewById(R.id.xEt);
    mEt.setTypeface(tf2);
    mEt.setTextColor(Color.BLACK);
    mEt.setTextSize(30);

enter image description here

like image 681
Attaullah Avatar asked Sep 27 '22 16:09

Attaullah


1 Answers

Set android:textIsSelectable="true" (API Level 11 and above) then look into the Clipboard manager in : Copy and Paste

like image 102
Syed Osama Maruf Avatar answered Sep 30 '22 06:09

Syed Osama Maruf