Change visibility

0

How do I change the visibility of a layout that is in another activity? I want to do this by clicking on an image .. I know how to use the onClick method. it just lacks the imagination of how to change visibility at runtime.

I've tried:

activityB B = new activityb();
B.layQueroEsconder.setVisible(GONE);

When I put this in onCreate of my activityA apk does not open.

    
asked by anonymous 01.04.2018 / 02:29

1 answer

0

I managed, in my activityB where the layout was to be hidden, I used:

layQueroEsconder.setVisibility(layQueroEsconder.getVisibility() ^ View.GONE);

Using the operardor "^" XOR it reversed the visibility.

    
01.04.2018 / 14:36