【发布时间】:2015-04-24 10:45:33
【问题描述】:
我收到了这个错误
指定的孩子已经有一个父母。您必须调用 removeView() 首先是孩子的父母
这是代码
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.categorylayout);
LinearLayout main = (LinearLayout)findViewById(R.id.main_layout);
View view = getLayoutInflater().inflate(R.layout.categoryeditor, main, true);
main.addView(view);
}
我收到此错误是因为我在这里传递了true:
inflate(R.layout.categoryeditor, main, true);
我的问题:
The specified child already has a parent父母在哪里?
【问题讨论】:
标签: android