Don't allow negative value from button press.
Good afternoon,

I have searched around for this answer, but because I am not exactly sure how to ask it, I am having a hard time finding an answer that fits my needs.  I was working on a golf score card tutorial, which I have completed, however, now I am looking to continue on with the application and make it even better.

Right now for each hole I have a score value with a "+" button and a "-" button, and when you hit that button it either does score--; or score++;

    case R.id.buttonMinus:
		score--;
		textScore.setText(String.valueOf(score));
		break;
	case R.id.buttonPlus:
		score++;
		textScore.setText(String.valueOf(score));
		break;


What I am wondering is how do I not allow "score" to be less than 0?

I would like users to be able to go up and down, but not less than 0.

Any help would be greatly appreciated!

Thanks!

Rob
Don't allow negative value from button press.
===

Good afternoon,

I have searched around for this answer, but because I am not exactly sure how to ask it, I am having a hard time finding an answer that fits my needs.  I was working on a golf score card tutorial, which I have completed, however, now I am looking to continue on with the application and make it even better.

Right now for each hole I have a score value with a "+" button and a "-" button, and when you hit that button it either does score--; or score++;

    case R.id.buttonMinus:
		score--;
		textScore.setText(String.valueOf(score));
		break;
	case R.id.buttonPlus:
		score++;
		textScore.setText(String.valueOf(score));
		break;


What I am wondering is how do I not allow "score" to be less than 0?

I would like users to be able to go up and down, but not less than 0.

Any help would be greatly appreciated!

Thanks!

Rob