1. PopupWindow嵌套Spinner报错问题
在PopupWindow中使用Spinner,一点击下拉列表,程序就会崩溃。控制台报错信息如下:
Unable to add window -- token android.view.ViewRootImpl$W@c3c9142 is not valid; is your activity running?
解决方式:在Spinner所在的xml文件中添加属性:
android:spinnerMode="dialog"
2. PopupWindow嵌套EditText无法弹出软键盘问题
在Activity中设置PopupWindow属性:
popupWindow.setFocusable(true);