TYPE_SYSTEM_OVERLAY in ICS

前端 未结 2 1665
盖世英雄少女心
盖世英雄少女心 2020-11-27 16:45

In Honeycomb I was able to create a system overlay with TYPE_SYSTEM_OVERLAY and receive touches with FLAG_WATCH_OUTSIDE_TOUCH.

Now ICS has changed something. I can s

2条回答
  •  被撕碎了的回忆
    2020-11-27 17:21

    To create an overlay view, when setting up the LayoutParams DON'T set the type to TYPE_SYSTEM_OVERLAY.

    Instead set it to TYPE_PHONE.

    Use the following flags:

    FLAG_NOT_TOUCH_MODAL

    FLAG_WATCH_OUTSIDE_TOUCH

    FLAG_NOT_TOUCH_MODAL << I found this one to be quite important. Without it, focus is given to the overlay and soft-key (home, menu, etc.) presses are not passed to the activity below.

提交回复
热议问题