In android we can change the cursor color via:
android:textCursorDrawable=\"@drawable/black_color_cursor\".
android:textCursorDrawable=\"@drawable/black_color_cursor\"
How can we do this dynamically?
You should change "colorAccent" and in order not to change this parameter for the whole application you can use ThemeOverlay. You can read more detailed in this article, the last section "Cursor and Selection"