Code example for ColorDrawable

Methods: getColor

0
		Drawable background = mView.getBackground();
 
		if (background instanceof ColorDrawable) {
			ColorDrawable cd = (ColorDrawable) background;
			if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
				return cd.getColor();
			} else { 
				if (!mBackgroundReflectionDone) {
					initBackgroundReflectionValues(cd);
				} 
 
				if (mBackgroundStateField == null
						|| mBackgroundUseColorField == null) {
					Log.w(TAG, ERR_BACKGROUND_COLOR);
					return Color.BLACK;
				} 
 
				Object colorStatusInstance = null;
 
				try { 
Contextual code suggestions in your IDE  Get Codota for Java