Either would work. That is, if it doesn't cause excessive garbage
collection, or makes a mess out your activity's code.
In one of my apps, I actually switch the entire content view.
The activity has two "modes", represented by two mostly different
layouts and respective helper objects (that implement the same base
interface).
When switching modes, I call setContentView with the right layoutId, and
create and keep its helper object. The activity implements the logic
common to both modes, and delegates to the current helper for the rest.
-- Kostya
23.09.2010 16:16, Hatch пишет:
Wow, that was fast.
Way to go. It works as you suggested. Thanks !
But do you now if it's better practice to have a
A) one big layout - remove elements by hand when necessary
B) small and common layout - add elements when needed.
Thank you
Hatch
On Sep 23, 1:57 pm, Kostya Vasilyev<[email protected]> wrote:
Use setVisibility(View.GONE)
GONE views are ignored during layout process and so do not consume
layout space.
-- Kostya
23.09.2010 15:53, Hatch пишет:
Now, I've already tried (although in vain) by using
button2.setVisibility(INVISIBLE). The element was not shown, but it
consumed the screen area never the less (so it was there, but just not
drawn nor active).
--
Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
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