Guest User

ceva

a guest
Feb 22nd, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  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);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment