Wednesday 17 May 2023

APPLICATION_OVERLAY doesn't take inputs on Android 13

I am building an overlay UI for my app. The UI takes inputs and works as expected on android <= 12 but on android 13 it becomes unresponsive. The exact same code/build works on Android 12 but not on 13. This is the code using which I am creating the overlay:-

View test = LayoutInflater.from(context).inflate(R.layout.test, null, false);

WindowManager.LayoutParams params =
    new WindowManager.LayoutParams(
        WindowManager.LayoutParams.WRAP_CONTENT,
        WindowManager.LayoutParams.WRAP_CONTENT,
        WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
        WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
        PixelFormat.OPAQUE);

windowManager.addView(test, params);

I have ensured that the app has "Draw over other apps" permission.

The android 13 behaviour change page also doesn't mention anything around APPLICATION_OVERLAY.



from APPLICATION_OVERLAY doesn't take inputs on Android 13

No comments:

Post a Comment