private final String SHAREDNAME = "System";
private static final int CHBOXNUM = 5;
private boolean chboxState[] = new boolean[CHBOXNUM];
private String chboxString[] = new String[] { "C", "M", "P","B", "T" };
public void readSettings() {
SharedPreferences reading = getSharedPreferences(SHAREDNAME,
Context.MODE_PRIVATE);
for (int i = 0; i < CHBOXNUM; i++) {
chboxState[i] = reading.getBoolean(chboxString[i], false);
}
}
public void saveSettings() {
SharedPreferences setting = getSharedPreferences(SHAREDNAME,
Context.MODE_PRIVATE);
Editor editor = setting.edit();
for (int i = 0; i < CHBOXNUM; i++) {
editor.putBoolean(chboxString[i], chboxState[i]);
}
editor.commit();
}