I'm having a problem with focus when using a floating window. My current code is:
WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
WindowManager.LayoutParams parameters = new WindowManager.LayoutParams(
200, 200, WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSLUCENT);
parameters.gravity = Gravity.CENTER;
RelativeLayout layoutView = new RelativeLayout(this);
...
windowManager.addView(layoutView, parameters);
The problem is that with this code only the floating window is focusable. I've tried changing the flags, but always either only the floating window, or the background application is focusable (so a keyboard will appear when I click an EditText
.
I want both the floating window and the background application be able to show a softkeyboard on an EditText
click.