TYPE_APPLICATION_OVERLAY make keyboard can't appearing

833 views Asked by At

i got a struggle with my apps, i'm planned to add floating text in my apps im using this code:

  wmParams = WindowManager.LayoutParams(
        WindowManager.LayoutParams.MATCH_PARENT,
        WindowManager.LayoutParams.MATCH_PARENT,

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
        else WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,

        WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
        PixelFormat.TRANSLUCENT
    )

this code running as i want, but then when i try to type something on another application, the keyboard wont show up. but the rest (e.g. button, gesture, opening other apps) was running, but not with the keyboard

i've already tried:

WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE

but none of these works any other ideas? thank you

1

There are 1 answers

1
creatyf co On BEST ANSWER

i've found the solution

need to implement multiple flag

WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,

hopefully help someone