专注于弹出窗口中的EditText会使活动进入睡眠状态

Hos*_*ein 4 android popupwindow android-edittext

我放置EditTextPopupWindow我的Android项目.设置PopupWindow.setFocusable为false时,将不显示软键盘.当设置PopupWindow.setFocusable为真时,EditText重点是活动进入睡眠状态!弹出窗口上的其他项目有效,但手机上的后退按钮和弹出窗口外的单击不会关闭它.提前致谢.

Ali*_*ran 10

我项目中的一些代码可能有所帮助

        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        PopupWindow  share_popup = new PopupWindow(inflater.inflate(R.layout.share_dropdown, null, false), 162, LinearLayout.LayoutParams.WRAP_CONTENT, true);
        share_popup.setOutsideTouchable(true);
        share_popup.setTouchable(true);
        share_popup.setFocusable(true);
        Drawable image_saved = getResources().getDrawable(R.drawable.dummy_bg);
        share_popup.setBackgroundDrawable(image_saved);
Run Code Online (Sandbox Code Playgroud)

R.drawable.dummy_bg是一个透明的图像.