Code example for LinearLayout

Methods: getParent

0
 
    @Override 
    public void onDestroyView() { 
        super.onDestroyView(); 
        if (mMainView != null) {
            if (mMainView.getParent() != null) {
                ViewGroup parent = (ViewGroup) mMainView.getParent();
                parent.removeView(mMainView);
            } 
        } 
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
 
        mMainView = (LinearLayout) inflater.inflate(
                R.layout.filtershow_main_panel, null, false); 
 
        looksButton = (ImageButton) mMainView.findViewById(R.id.fxButton);
        bordersButton = (ImageButton) mMainView.findViewById(R.id.borderButton);