Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public void buttonClick (View v)
  2. {
  3.  
  4.  
  5. EditText num = (EditText) findViewById(R.id.ETnumber);
  6. EditText name = (EditText) findViewById(R.id.ETname);
  7. TextView tvNum = (TextView) findViewById(R.id.tvNumEnt);
  8. TextView tvName = (TextView) findViewById(R.id.tvNumEnt);
  9.  
  10.  
  11.  
  12. int value = Integer.parseInt(num.toString());
  13. if (value > 10)
  14. {
  15. tvNum.setText("ERROR");
  16. num.setText("");
  17.  
  18. }
  19. else if (value < 1)
  20. {
  21. tvNum.setText("ERROR");
  22. num.setText("");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement