The specified child already has a parent. You must call removeView() on the child's parent first.
来源:互联网 发布:淘宝上哪个螺蛳粉正宗 编辑:程序博客网 时间:2024/04/29 11:46
FATAL EXCEPTION: main java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.view.ViewGroup.addViewInner(ViewGroup.java:3337) at android.view.ViewGroup.addView(ViewGroup.java:3208) at android.view.ViewGroup.addView(ViewGroup.java:3188) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260) at com.yawa.listener.EditTextClickListener.afterContextInput(EditTextClickListener.java:49) at com.yawa.listener.EditTextClickListener.onClick(EditTextClickListener.java:40) at android.view.View.performClick(View.java:3511) at android.view.View$PerformClick.run(View.java:14105) at android.os.Handler.handleCallback(Handler.java:605) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method)
android中的dialog 中也就是说child已经有一个parent,必须进行removeView(),出错的具体原因我也不是特别的清楚不过下面是我解决的方法,可以从window窗口中直接继承过来!
public void afterContextInput() {AlertDialog builder = new AlertDialog.Builder(mActivity).create(); builder.show();builder.getWindow().setContentView(R.layout.edittext_input);builder.setCancelable(false);}
这样的话可以从window中直接继承就不用在从你的类中继承了!
讲的不是清晰,知道怎么解决就好,如果不明白可以留言!
- 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.
- 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
- 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.
- 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.
- 总是报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.解决办
- 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.
- 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
- 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.
- 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.
- java json字符串处理
- UNIX网络编程卷一 笔记 第7章 套接字选项
- android 自定义属性通过反射关联组件与方法
- 推荐ios新手学习网站
- java链接mysql数据库
- The specified child already has a parent. You must call removeView() on the child's parent first.
- SQLite Administrator 中文乱码的问题
- tp命令进行transport请求
- 软件版本怎么定义
- Spring-MVC入门:入门实例
- [基础]RHEL本地yum配置
- enum 变态用法
- Eclipse3.6 下载链接
- Block介绍(一)基础