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
Two problems with your code.
You can try this instead
public class MainActivity extends Activity
implements View.OnClickListener {
private int counter;
@Override
public void onClick(View v) {
if (view.getId() == R.id.Spinbtn) { // change to your button id
counter++;
}
if (counter >= 2) {
showcalcuation();
} else {
// hide calculation?
}
}
...
// in onCreate
button.setOnClickListener(this);