1

In my android application I am using EditText.

In that EditText I don't want to show blue cursor pointer as shown in below figure : -

enter image description here

Reason for doing so is that user can not enter pasted data in EditText and allow user to enter text manualy.

Kindly provide me solution.

Thanks in advance.

EDIT : When user clicks on blue pointer hint option is shown.

void
  • 479
  • 2
  • 13
  • 27
  • please refer to http://stackoverflow.com/questions/12910305/android-how-do-i-stop-a-pointer-appearing-below-an-edittext – Arya Feb 28 '14 at 11:35

2 Answers2

2

Add the following line to Edittext xml...

android:cursorVisible="false"

If you want to disable the cursor programatically then...

editText.setCursorVisible(false)
Hamid Shatu
  • 9,664
  • 4
  • 30
  • 41
  • 3
    I don't want to hide cursor.I only want to hide blue cursor indicator below cursor as shown in figure. – void Feb 28 '14 at 11:30
1

Reason for doing so is that user can not enter pasted data in EditText and allow user to enter text manualy.

Actually you want to disable the copy/paste option in your EditText. The blue cursor is a system helper that allows user to move the cursor so quickly. To disable copy/paste you must prevent the context menu appearing by setting a Custom CallBack using setCustomSelectionActionModeCallback()

Solution : How to disable copy/paste from/to EditText

Community
  • 1
  • 1
Sankar V
  • 4,794
  • 3
  • 38
  • 56
  • 2
    The cursor still shows with this approach, and clicking on the cursor pointer results in the "Paste" menu appearing, which it appears that the OP wants to avoid. – CJBS Jan 08 '15 at 00:48