Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/201.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
popupwindow中的EditText显示android中的坏令牌错误?_Android_Layout Inflater - Fatal编程技术网

popupwindow中的EditText显示android中的坏令牌错误?

popupwindow中的EditText显示android中的坏令牌错误?,android,layout-inflater,Android,Layout Inflater,Am在弹出窗口中使用编辑文本Am在编辑文本中输入值后,它显示一些错误的令牌错误。任何人都可以知道,请帮助我解决此问题 我的弹出窗口编码。 inflater1 = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); popupView = inflater1.inflate(R.layout.image_pop_up, null, true);

Am在弹出窗口中使用编辑文本Am在编辑文本中输入值后,它显示一些错误的令牌错误。任何人都可以知道,请帮助我解决此问题

我的弹出窗口编码。

 inflater1 = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                popupView = inflater1.inflate(R.layout.image_pop_up, null, true);
                pw = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
                pw.setFocusable(true)
    EditText name = (EditText)popupView.findViewById(R.id.edittext1);
    pw.showAtLocation(activity.findViewById(R.id.order_page_xml), Gravity.CENTER, 0, 15);
我的日志猫错误是

05-11 17:44:05.381: E/AndroidRuntime(1558): android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@4169cf30 is not valid; is your activity running?
05-11 17:44:05.381: E/AndroidRuntime(1558):     at android.view.ViewRootImpl.setView(ViewRootImpl.java:513)
05-11 17:44:05.381: E/AndroidRuntime(1558):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:301)

为弹出窗口和编辑文本添加一些代码。@Hardik am在充气器1中添加我的弹出窗口的代码。充气只是将最后一个参数设置为false。@HoanNguyen am也有同样的问题。查看