As someone in your other thread already mentioned: you need to keep track 
of these layout changes you do and save this information in the 
onSaveInstanceState method. You could save a boolean value for example that 
indicates that "Button 2" has been added. In onCreate you need to read the 
savedInstanceState Bundle and check whether that "Button 2" flag is 
present. If that is the case you have to re-create Button 2 then.

Some pseudo code:

onSaveInstanceState(Bundle outState) {
    outState.putBoolean("button2", true);
}

onCreate(Bundle savedInstanceState) {
    if(savedInstanceState != null) {
        if(savedInstanceState.getBoolean("button2")) {
             // Add button 2 to your layout
        }
    }
}

-- 
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