Code example for ColorStateList

0
		this.setTag(tag);
		_buttonView = new HububButtonView(DroidHubub.getInstance());
		//_buttonView.setBackgroundColor(Color.MAGENTA); 
		_buttonView.setText(name);
		_buttonView.setOnClickListener(this);
		_buttonView.setTextColor(new ColorStateList(
				new int[][] { 
						new int[] { android.R.attr.state_focused },
						new int[] {android.R.attr.state_pressed},
						new int[] {android.R.attr.state_selected},
						new int[0], 
				}, new int[] { 
						//Color.rgb(0, 0, 255), 
						Color.WHITE,
						Color.GREEN,
						Color.GREEN,
						Color.BLACK,
				} 
		)); 
		if(Build.MANUFACTURER.equals("motorola") && Build.VERSION.RELEASE.startsWith("2.2"))
			_buttonView.setTextColor(Color.WHITE);