The specified child already has a parent. You must call removeView() on the child's parent first.的解決辦法
摘要: 出現The specified child already has a parent. You must call removeView() on the child's parent first.這個問題,一般原因是對layout.xml的使用理解不清楚。以xml文件方式來設計界面的布局,如果需要動態的對xml文件中的各類View進行修改的話,在代碼中使用時,不能直接使用this.findViewById(R.id.***)來獲取xml文件中的每個View,然后再將這些View加入到代碼中的Layout中來進行顯示。正確的做法應該是使用inflater。
閱讀全文
posted @ 2010-12-11 22:28 江天部落格 閱讀(8094) | 評論 (0) 編輯