1
The Edittext has an attribute that defines the drawable to be used for the cursor.
Create the drawable:
my_cursor.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<size android:width="1dp" />
<solid android:color="#FF0000" />
</shape>
size android:width
defines the thickness.
solid android:color
sets the color.
Attribute this drawable to the attribute android:textCursorDrawable
:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textCursorDrawable="@drawable/my_cursor"/>