FileDocCategorySizeDatePackage
Reparenting.javaAPI DocAndroid 5.1 API2690Thu Mar 12 22:22:44 GMT 2015com.android.transitiontests

Reparenting

public class Reparenting extends android.app.Activity

Fields Summary
android.view.ViewGroup
mSceneRoot
android.view.ViewGroup
mContainer1
android.view.ViewGroup
mContainer2
private View.OnClickListener
mButtonListener
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);
        setContentView(R.layout.reparenting);

        ViewGroup container = (ViewGroup) findViewById(R.id.container);
        mContainer1 = (ViewGroup) findViewById(R.id.container1);
        mContainer2 = (ViewGroup) findViewById(R.id.container2);
        System.out.println("container 1 and 2 " + mContainer1 + ", " + mContainer2);

        setupButtons(0, mContainer1);
        setupButtons(3, mContainer2);

        mSceneRoot = container;
    
private voidsetupButtons(int startIndex, android.view.ViewGroup parent)

        for (int i = startIndex; i < (startIndex + 3); ++i) {
            Button button = new Button(this);
            button.setText(Integer.toString(i));
            button.setOnClickListener(mButtonListener);
            parent.addView(button);
        }