popupwindow中的EditText显示android中的坏令牌错误?
Am在弹出窗口中使用编辑文本Am在编辑文本中输入值后,它显示一些错误的令牌错误。任何人都可以知道,请帮助我解决此问题 我的弹出窗口编码。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);
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也有同样的问题。查看