SHOW:
|
|
- or go back to the newest paste.
| 1 | //make a private field to hold the new values | |
| 2 | ||
| 3 | private ArrayList<Integer> holdValues = new ArrayList<Integer>(); | |
| 4 | ||
| 5 | // then in your createNewAddButton() method add: | |
| 6 | holdValues.add(1); | |
| 7 | ||
| 8 | //and in you NewAddButton OnClickListener add : | |
| 9 | int tmp = v.getId(); | |
| 10 | plusNew((tmp - 1001)); | |
| 11 | EditText temp = (EditText) findViewById(1 + (tmp - 1001)); | |
| 12 | temp.setText("" + currentValueNew);
| |
| 13 | ||
| 14 | //modify the plusNew() method: | |
| 15 | ||
| 16 | public void plusNew(int i) {
| |
| 17 | int temporary = holdValues.get(i); | |
| 18 | if (temporary <= 999) {
| |
| 19 | temporary = temporary + 1; | |
| 20 | - | holdValues.setValue(i, temporary); |
| 20 | + | holdValues.set(i, temporary); |
| 21 | } | |
| 22 | } |