Android suspended window shields the instance code of all click events outside the suspended window

Android can add a view above all applications, that is, add a view to WindowManager. When creating a view, you can set the layoutparams (Android. View. WindowManager. Layoutparams. Layoutparams()) property for the view. By default, all click events outside the view area are blocked, that is, when the view is displayed, other areas of the screen are not clickable, Including menu and return key, etc. After setting the appropriate flag for layoutparams, other areas can respond to clicks.

Example code:

This line of code controls the area outside the view to respond to click and touch events. If flag is not set, areas outside view cannot respond

The above is the example code of Android floating window shielding all click events outside the floating window introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>