I am new to Android. Let someone give some ideas for my problem.
final LinearLayout par_layout=new LinearLayout(this); par_layout.setOrientation(LinearLayout.VERTICAL); final LinearLayout chl_layout=new LinearLayout(this); chl_layout.setOrientation(LinearLayout.VERTICAL); TextView tv_name=new TextView(this); tv_name.setText("Name "); TextView tv_item=new TextView(this); tv_item.setText("Items "); Button btn_submit=new Button(this); btn_submit.setText("Submit"); btn_submit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {
In the above code, when I click the button, I want to clear chl_layout from par_layout. But I can not. Can someone give some ideas?
Note: The following code also does not work
par_layout.removeView(chl_layout);
source share