I need to hide a button during an onClick action like this:
public void onClick(View view) {
switch (view.getId()){
case R.id.button1:
Button button2 = (Button) findViewById(R.id.button2);
button2.setVisibility(View.GONE);
//Some methods
//...
button2.setVisibility(View.VISIBLE);
break;
}
But the visibility changes only after the onClick, what could I do to hide the button during the onClick?
Thanks