首页 > 其他 > 详细

AlertDialog The specified child already has a parent. You must call removeView() on the child's parent first.

时间:2014-10-18 13:49:36      阅读:301      评论:0      收藏:0      [点我收藏+]

点击AlertDialog 关闭之后再点击报错:

 

The specified child already has a parent. You must call removeView() on the child‘s parent first.

 

意思是这个子view 已经有个父view了,你现在要使用的话,必须把子view从父view中移除掉。

解决:

 加上 : ((ViewGroup) view.getParent()).removeView(view);  

 

 

builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {

 

((ViewGroup) layout.getParent()).removeView(layout);
}
});

 

 
 

AlertDialog The specified child already has a parent. You must call removeView() on the child's parent first.

原文:http://www.cnblogs.com/Ringer/p/4032892.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!