Disable EditText Cursor Android


In order to disable EditText (TextFileds) Blinking Cursor in your Android Activity you can either add a line of code in your activity layout.xml file or in the Activity Java Class file.

To Hide EditText Cursor and the below line in Layout.xml,

android:cursorVisible="false"

Example:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="55sp"
        android:layout_margin="4dp"
        android:cursorVisible="false"
        android:ems="10"
        android:inputType="textPassword" >
        <requestFocus />
    </EditText>
</LinearLayout>



Recent Posts:




Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.