lin_item为一个LinearLayout,把view动态加到这个lin_item中,但是只能加进一条数据。。。要不然就报07-28 22:03:49.360: ERROR/AndroidRuntime(1403): Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. 这个异常,我知道view为同一个,所以会产生这种异常。但是我就是要这样动态的加入view到lin_item里啊。。有没什么办法呢。。
如果这样写就没问题了。。但是还是同一个layout啊。。。我知道原因的,但有没办法可以像上面那样动态的生成view并加到linearLayout里。。。
以上同样情况。。同一个view不能让父view addview 2次,所以解决办法是:
|