Android-使用了popupWindow里面并包含了(EditText),需要点击其他地方popupWindow不关闭,并且EditText需要获得焦点的处理
1、.setFocusable(true) 2、设置setTouchModal(false) 但是这个方法只有29以上版本才有 需要用反射 方法为: public static void setPopupWindowTouchModal(PopupWindow popupWindow, boolean touchModal) { if (null == popupWindow) { return; } Method method; try { method = PopupWindow.class.getDeclaredMethod("setTouchModal", boolean.class); method.setAccessible(true); method.invoke(popupWindow, touchModal); } catch (Exception e) { e.printStackTrace(); } }