Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText cursor becomes invisible in JellyBean

In my app, I have an edit text with properties:

android:inputType="none" and android:textIsSelectable="true".

It's because I have defined my own buttons to enter input (buttons, not custom keyboard). I have used

editText.requestFocus()

to make the cursor visible. Upto to android 4.0.4, the cursor is visible and not in phones running Jelly Bean. The cursor isn't visible but I'm able touch and enter text between characters ( using editText.getSelectionStart() ).

What has changed in Jelly Bean? How do I make the cursor visible?

Edit: android:cursorVisible="true" isn't helping.

like image 569
Frozen Crayon Avatar asked Aug 20 '13 15:08

Frozen Crayon


2 Answers

Removing android:textIsSelectable="true (text is selectable even without this)

and adding

android:textCursorDrawable="@null" fixed the issue.

like image 98
Frozen Crayon Avatar answered Sep 19 '22 15:09

Frozen Crayon


In Jellybeans, it happens if you set background to editText.

To show cursor in editText, just use android:textCursorDrawable="@null" and android:textColor="@color/someColor"

like image 37
Shrikant Ballal Avatar answered Sep 18 '22 15:09

Shrikant Ballal