In general, the cursor in EditText always EditText How to make it glow only when I click on EditText and write something in it?

    2 answers 2

    remove the attribute <requestFocus /> and add it to xml

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:descendantFocusability="beforeDescendants" android:focusableInTouchMode="true" > 
    • one
      Now when you open the activation with edittexts, the cursor does not blink by default. when I click - it flashes, when I click to another place, it still remains to flash ... - denqxotl
    • It works fine for me. I added the specified code to the parent LinearLayout. - Andrew Grow

    Attribute

     android:cursorVisible="false" 

    Something like this:

     <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:cursorVisible="false" > <requestFocus /> </EditText> 
    • requestFocus works with only one EditText. And I have several of them. - denqxotl
    • one
      This solution simply removes the cursor from the EditText, but it is still selected. You can make sure of this if you use FloatingLabels, so I would call it a bad decision. - Kostya Bakay pm