问题
I have following problem:
I want to create a toolbar, with general setting for device (TV) by adding view to window manager. My toolbar is visible in the bottom of screen and it is an overlay on currently selected application. It has following parameters/flags:
WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
-WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
-WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
-WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
-PixelFormat.TRANSLUCENT
When I click on the toolbar it is working fine. When I click on the background, toolbar is still at foreground, and background application is working fine.
The problem starts, when I am populating ListView
from my toolbar. With those parameters, onClick
and onSelectItem
listeners are not working on that ListView
. When I remove FLAG_NOT_FOCUSABLE
, listeners start to work, but I cannot use background application any more. I have to close my toolbar in order to get focus on the background.
Do you have any idea, how to make both ListView
and background application responsiveness?
Thanks in advance, for every answer/
回答1:
This is known issue with PixelFormat.TRANSLUCENT, try PixelFormat.TRANSPARENT
来源:https://stackoverflow.com/questions/12859379/adding-focusable-view-to-window-manager-without-losing-responsiveness-on-backgro