-1

I want to know how to make some of the buttons appear or visible while clicking other buttons. Like when you add two inputs with 'plus' button, I want buttons to appear instead of summing up.

I don't really have a lot of experience with android studio, but I have tried to search what can help me, however, I couldn't find anything.

Maddy
  • 4,525
  • 4
  • 33
  • 53
TLuna7
  • 9
  • 5

1 Answers1

2

You can try this

Button button1;
Button button2;



        //set a onClickListener on button1 
  button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (button2.getVisibility() == View.VISIBLE){
                button2.setVisibility(View.INVISIBLE);
                } else button2.setVisibility(View.VISIBLE);
            }

});
Xylan
  • 142
  • 2
  • 13