Search code examples
androidoverlayback-buttonforegroundandroid-windowmanager

Back-button blocked by an app running above all other apps


I'm developing an android application that runs above all other apps, based on this example.

The problem is that when this service is running back button has no effect anywhere (except notification panel, which can be closed by back button, because it is above my app).

Question: How to make the back button "ignore" my app and do it's function for the app below?


Solution

  • I found what I was looking for:

    Simply changed

    WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
    

    to

    WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,