Set EditText cursor color
For anyone that needs to set the EditText cursor color dynamically, below you will find two ways to achieve this. First, create your cursor drawable: Set the cursor drawable resource id to the drawable you created (...
Technical answers from my Stack Overflow history, with source links and licenses.
Showing 3 of 3 answers tagged android-styles
Exported May 9, 2026
For anyone that needs to set the EditText cursor color dynamically, below you will find two ways to achieve this. First, create your cursor drawable: Set the cursor drawable resource id to the drawable you created (...
ColorStateList in android:tint was not supported prior to API 21. See: https://code.google.com/p/android/issues/detail?id=204671 You can use AppCompat's AppCompatResources and support-v4 DrawableCompat to support...
Finding how to change styles for widgets on Android has always been troublesome. For example, DatePickerDialog has different styles for Holo and Material design. So, the style of the dialog may depend on the SDK value...