I place an EditText
on a PopupWindow
in my android project. When set PopupWindow.setFocusable
to the false, the soft keyboard will not be show. And when set PopupWindow.setFocusable
to the true, the EditText
is focused and activity go to sleep!
Other item on the pop up window works, but back button on the phone and clicking outside the pop up does not close it.
Thanks in advance.
Some code from my project may help
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);
where this R.drawable.dummy_bg
is a transparent image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With