bringToFront for Floating Window TYPE_APPLICATION_OVERLAY

284 views Asked by At

I have created multiple Floating Windows using TYPE_APPLICATION_OVERLAY as below

WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                width,
                height,
                x,
                y,
                WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
                        WindowManager.LayoutParams.FLAG_SECURE |
                        WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES |
                        WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING |
                        WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM |
                        WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
                , PixelFormat.TRANSLUCENT);
                params.gravity = gravity;
                (WindowManager) (hostApp.getSystemService(Context.WINDOW_SERVICE)).addView(view, params);

2 Floating windows were created in order W1, W2. W2 shows on top of W1. I want to bring the W1 window to front.

Looking for something similar to

view.bringToFront();

for overlays.

0

There are 0 answers