Code example for RelativeLayout

Methods: addView

0
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
         
        mLayout = new RelativeLayout(this);
        final RelativeLayout.LayoutParams adViewLayout = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        adViewLayout.addRule(RelativeLayout.CENTER_IN_PARENT);
        mLayout.addView(getAdView(), adViewLayout);
        setContentView(mLayout);
         
        showInterstitialCloseButton(); 
    } 
     
    public abstract View getAdView();
     
    protected void showInterstitialCloseButton() { 
        if (mCloseButton == null) {
            StateListDrawable states = new StateListDrawable();
            states.addState(new int[] {-android.R.attr.state_pressed},