Shane Duffy Shane Duffy - 3 months ago 17
Android Question

How to prevent custom dialog from blinking cursor on first EditText inside of it

I am creating a custom

Dialog
window but my problem is when the dialog first launches it automatically begins flashing the cursor on the FIRST
EditText
in the
LinearLayout
that defines the structure of the dialog. The keyboard does not appear, but the first
EditText
always has this blinking cursor on it.

I attempted to use the
RequestFocus()
function on a
TextView
within the dialog that cannot be edited, but the blinking cursor remains on the first
EditText
in the dialog.

If anyone has any advice or solutions to solving this problem, that would be great.

DsD DsD
Answer

Use either XML attribute or Java function-

xml:

android:cursorVisible="false" 

Java function:

setCursorVisible(false)
Comments