One important thing to keep in mind is getCurrentTextColor (), as well as similar methods like getCurrentHintTextColor () and getHighlightColor () return int value, not hex, which are mainly used to determine colors. This can be even more confusing, as this is a negative number, for example, for red it is -65536, for green -16711936 and for white -1.
To make this simple, this is because getCurrentTextColor () returns the difference between the current color and the white value (both in decimal) minus 1. Expression: CurrentColor- (WhiteColor + 1), where white is 16777215. Of course, for standard colors you you can use predefined constants like Color.GREEN or Color.MAGENTA, but knowing that you can effectively use getCurrentTextColor () for any colors.
You can learn even more about setting up and getting colors in Android at http://android4beginners.com/2013/07/lesson-1-3-how-to-change-a-color-of-text-and-background-in -textview /
Android4Beginners Jul 05 '13 at 11:36 on 2013-07-05 11:36
source share