Change visibility

Asked

Viewed 54 times

0

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

I’ve tried to:

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

When I put this on onCreate of my activityA the apk nor opens.

1 answer

0

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

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

Using the operator "^" XOR he reversed the visibility.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.