Guest User

Untitled

a guest
Nov 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. btnPoint.setOnClickListener(new View.OnClickListener() {
  2. @OnClick(R.id.btn_punt)
  3. public void onClick(View view) {
  4. //Boolean method endstring character
  5. getCalculationText();
  6. // als calculation eindigt met "." of als calculation leeg is
  7. if(stringEndsWithOperator() || calculation.isEmpty())
  8. {
  9. // doe calculation + niks
  10. tvCalculation.setText(calculation + "");
  11. }
  12. // als calculation niet eindigt met een "."
  13. else if(!stringEndsWithOperator())
  14. {
  15. // doe calculation + "."
  16. tvCalculation.setText(calculation + ".");
  17. }
  18. }
  19. });
Add Comment
Please, Sign In to add comment