标签:
报错的代码是:
The specified child already has a parent. You must call removeView() on the child's parent first
解决办法是每次显示之前都又一次填充设置view.例如以下:每次点击的时候调用:
public void startClick(View view){ LayoutInflater inflater = LayoutInflater.from(getApplication()); mFloatLayout = (LinearLayout)inflater.inflate(R.layout.province_item, null); builder = new AlertDialog.Builder(MainActivity.this) .setView(mFloatLayout); ad = builder.show(); }
标签:
原文地址:http://www.cnblogs.com/mengfanrong/p/5135850.html