Insert option for edittext

I have an edittext, and I would like to insert text into it. I can copy text from some webpage, but I cannot paste text into my edittext control. How can I turn on my editor to insert some text. Here is my main.xml for edittext;

enter code here

<EditText 
   android:id="@+id/enter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight= "2"
android:scrollbars="vertical"
android:textColor="@color/black"
/>

thank

+5
source share
4 answers

This is on Android 4.4.2 Samsung S4;

The documentation for TextView says that:

TextView , XML android: textIsSelectable, "true" setTextIsSelectable (true). textIsSelectable TextView, .

Textview, android: cursorVisible, , /.

, , // . , android:textIsSelectable="false", android:cursorVisible="false" , - EditText. , -, . , , xmls, android:inputType, .

, android:cursorVisible="true" EditText, .

+6

/ TextView, U : : TextView

android:textIsSelectable="true"

Java , .

myTextView.setTextIsSelectable(true);

mContext.myTextView.setTextIsSelectable(true);

TextView /.

+2

According to your problem, if you copied some data anywhere on your system and want to paste it into some specific variable, such as Edit TextBox, Textview, etc., this code will certainly help you.

 ClipboardManager clipMan = (ClipboardManager)getSystemService(v.getContext().CLIPBOARD_SERVICE);
 myEdtTxt.setText(clipMan.getText());

Note: here the clipMan object will store data whenever the copying process is completed, and we will return this data from this object and install it,

+1
source

Try setting inputType="text"for the fieldEditText

0
source

All Articles