I was thinking if there was a simple way to keep pressing the same button so that the counter keeps adding by 1 every time. So that if the button is clicked two times it will ha
First, make this global within your class:
int counter = 0;
Then implement the button click event:
final Button button = (Button) findViewById(R.id.Spinbtn);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
if(view.getId() == R.id.Spinbtn){
if(counter == 2){
showcalcuation();
}else if(counter < 2){
counter += 1;
}
}
}
});