Not able to dynamically remove LinearLayout in Android. How to do it?
<pre><code>public void onClick_addContact(View v)
    {
            LinearLayout layout = (LinearLayout) findViewById(R.id.layoutLinear);
            layout.addView(linearlayout(_intMyLineCount));
            _intMyLineCount++;



    }


    private EditText editText(int _intID) {
            EditText editText = new EditText(this);
            editText.setId(_intID);
            editText.setHint("My lines");
            editText.setWidth(180);         

            editTextList.add(editText);
            return editText;
        }

       private TextView textView(int _intID)
        {
            TextView txtviewAll=new TextView(this);
            txtviewAll.setId(_intID);
            txtviewAll.setText("My lines:");        

            textviewList.add(txtviewAll);
            return txtviewAll;
        }

       private Button button(int _intID)
       {
           Button btn = new Button(this);
           btn.setId(_intID);
           btn.setTag("but1");
           btn.setOnClickListener(newContact);


           return btn;


       }

       OnClickListener newContact = new OnClickListener() {
                //onClick view
                public void onClick(View v) {


                    LinearLayout layout =  (LinearLayout)v.getParent();

                    layout.removeViewInLayout(v);
                   // setContentView(layout);

                        _intMyLineCount--;

                                    }

               };

       private LinearLayout linearlayout(int _intID)
        {
            LinearLayout LLMain=new LinearLayout(this);
            LLMain.setId(_intID);       
            LLMain.addView(textView(_intID));
            LLMain.addView(editText(_intID));
            LLMain.addView(button(_intID));
            LLMain.setOrientation(LinearLayout.HORIZONTAL);

            linearlayoutList.add(LLMain);
            return LLMain;

        } 
</code></pre>

<p>In the newOnContact Listener,  only the child button gets deleted, but not the entire linear layout that includes the textView and EditText.
How to do it?</p>
