Code example for ViewGroup

Methods: addView, bringToFront, setVisibility

0
        // Finally show the custom view container. 
        parent.setVisibility(View.VISIBLE);
        parent.bringToFront();
    } 
 
    public void hideCustomView() { 
        // This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0 
        Log.d(TAG, "Hidding Custom View");
        if (mCustomView == null) return;
 
        // Hide the custom view. 
        mCustomView.setVisibility(View.GONE);
         
        // Remove the custom view from its container. 
        ViewGroup parent = (ViewGroup) this.getParent();
        parent.removeView(mCustomView);
        mCustomView = null;
        mCustomViewCallback.onCustomViewHidden();
         
        // Show the content view. 
        this.setVisibility(View.VISIBLE);