写了一个app来投影,用了MediaProjection的createVirtualDisplay(String name, int width, int height, int dpi, int flags, Surface surface, VirtualDisplay.Callback callback, Handler handler),文档说明就一句话: Creates a VirtualDisplay to capture the contents of the screen. 这个意思应该就是数据源是screen吧,现在我只想要抓取我APP内部的视图,该怎么做呢?
现在大部分android手机取消物理按键,那三个键都显示在屏幕上了,我不想要投影这三个键,该怎么设置啊?
还有这个flag,我不太看得懂了,下面几个flag我都一一试过了,投影过去的东西没有任何差别。
VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR
Virtual display flag: Allows content to be mirrored on private displays when no content is being shown.
int VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
Virtual display flag: Only show this display's own content; do not mirror the content of another display.
int VIRTUAL_DISPLAY_FLAG_PRESENTATION
Virtual display flag: Create a presentation display.
int VIRTUAL_DISPLAY_FLAG_PUBLIC
Virtual display flag: Create a public display.
int VIRTUAL_DISPLAY_FLAG_SECURE
Virtual display flag: Create a secure display.
现在大部分android手机取消物理按键,那三个键都显示在屏幕上了,我不想要投影这三个键,该怎么设置啊?
还有这个flag,我不太看得懂了,下面几个flag我都一一试过了,投影过去的东西没有任何差别。
VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR
Virtual display flag: Allows content to be mirrored on private displays when no content is being shown.
int VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
Virtual display flag: Only show this display's own content; do not mirror the content of another display.
int VIRTUAL_DISPLAY_FLAG_PRESENTATION
Virtual display flag: Create a presentation display.
int VIRTUAL_DISPLAY_FLAG_PUBLIC
Virtual display flag: Create a public display.
int VIRTUAL_DISPLAY_FLAG_SECURE
Virtual display flag: Create a secure display.