So, I'm trying to control the visibility of a view in my app with setVisibility, but it's not working.

Here's what I do.

The layout doesn't specify visibility, so it gets the default visibility of "VISIBLE". The layout looks like this:

FrameLayout {
    SurfaceView // background
    LinearLayout {
            View  // button
            View // button
            View  // button
        }
}

In code, just after I setContentView( myframe ) in my Activity's constructor, I get the views for the three buttons and setVisibility( View.INVISIBLE ) on them.

So far, this part works. If I don't setVisibility( View.INVISIBLE ) I can see the three views right where they are supposed to be, and when I setVisibility( View.INVISIBLE ) I can't see them. So far so good.

Ok, so I do some work and now I want to see those buttons again. So I go in and setVisibility( View.VISIBLE ) on them.

They don't show up.

I've tried calling invalidate() on the views, bringToFront(). Seems like once they are hidden I can't bring them back.

Anyone have any ideas why this wouldn't be working?

I should note that the background view is a GLSurfaceView, but I don't think that should cause any problems, should it?

Cheers,

Chris...

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to