Code example for ColorDrawable

Methods: getColor

0
	View.OnClickListener customTexts(final EditText et) {
		return new View.OnClickListener() {
			@Override 
			public void onClick(View v) {
				ColorDrawable backgroundColor = (ColorDrawable)et.getBackground();
				int color = backgroundColor.getColor();
				System.out.println("Color: " + color);
				if (et.getText().toString().length() != 0) {
					if (color == 0xffffffff || color == -1) {
						et.setBackgroundColor(0xff00ff00);
					} else if (color == 0xff00ff00) {
						et.setBackgroundColor(0xffffcc00);
					} else if (color == 0xffffcc00) {
						et.setBackgroundColor(0xff0000ff);
					} else if (color == 0xff0000ff) {
						et.setBackgroundColor(0xffff0000);
					} else if (color == 0xffff0000) {
						et.setBackgroundColor(0xffffffff);
					} 
				} 
			}