I have two onclick actions that modifies a shared preference file :
int value = counters.getInt("wcounter", 0);
wcounter = value;
wcounter++;
Editor editor = counters.edit();
editor.putInt("wcounter", wcounter);
editor.commit();
and
int value = counters.getInt("wcounter", 0);
wcounter = value;
wcounter--;
Editor editor = counters.edit();
editor.putInt("wcounter", wcounter);
editor.commit();
but when the first one is re executed it takes it's old value.