public void onClick(View v) {
                Button newButton = new Button(LayoutAnimationsActivity.this);
                newButton.setPadding(5, 5, 5, 5);
                newButton.setText(String.valueOf(numButtons++));
                newButton.setOnClickListener(new View.OnClickListener() {
                    public void onClick(View v) {
                        container.removeView(v);
                    }
                });
                container.addView(newButton, Math.min(1, container.getChildCount()));
            }
Called when the activity is first created.
app/src/main/java/home/smart/fly/animations/property/LayoutAnimationsActivity.java