HTML/JavaScript小工具

HTML/JavaScript小工具

2013年4月1日 星期一

當你做Fragmnet 出現 The specified child already...時候


04-01 18:46:03.279: E/AndroidRuntime(3077): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testtab2/com.example.testtab2.MainActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.



以上錯誤可能因為
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.test_tab1, container,false);

}
inflater.inflate(R.layout.test_tab1, container,false);你的false沒有設定!!


沒有留言:

張貼留言