This is the code. The range is just a value that I use buttons to add or subtract to it. And once the value hits a barrier it makes the button unusable until it is off the barrier.
Button button2 = (Button)findViewById(R.id.button2);
if(range == 10001) {
button2.setEnabled(false);
}
else {
button2.setEnabled(true);
}
Button button3 = (Button)findViewById(R.id.button3);
if(range == 1001) {
button3.setEnabled(false);
}
else {
button3.setEnabled(true);
}