Java tutorial
//package com.java2s; import java.util.Hashtable; import android.graphics.Color; import android.widget.Button; public class Main { public static void setButtonStyles(Hashtable<Integer, Button> buttonHash, Boolean undo) { int color = (undo) ? Color.RED : Color.BLUE; for (Integer bID : buttonHash.keySet()) { buttonHash.get(bID).setTextColor(color); } } }