For example, you built a hover box:
WindowManager WindowManager = Getwindowmanager (context); int screenwidth = Windowmanager.getdefaultdisplay (). getWidth (); if (Smallwindow = = null) {Smallwindow = new Floatwindowsmallview (context); if (smallwindowparams = = null) {SMALLWINDOWP Arams = new Layoutparams (); smallwindowparams.type = Layoutparams.type_system_alert;smallwindowparams.format = Pixelformat.rgba_8888;smallwindowparams.flags = layoutparams.flag_not_touch_modal| layoutparams.flag_not_focusable;smallwindowparams.gravity = Gravity.left | Gravity.top;smallwindowparams.width = Floatwindowsmallview.viewwidth;smallwindowparams.height = floatwindowsmallview.viewheight;smallwindowparams.x = Screenwidth;smallwindowparams.y = 0; Smallwindow.setvoipuipaddingbottom (paddingbottom);} Smallwindow.setparams (Smallwindowparams); Windowmanager.addview (Smallwindow, smallwindowparams);}
If you use a Xiaomi phone, you will find that the window receives no messages, the message will be transmitted to the next layer, if the next layer has no recipients, will be received. You can receive messages when you set the hover box of your app to allow in the "Security Center", "Authorization Management"->[app Rights Management]-> "Rights Management". This should be a unique place for Xiaomi Rom, and there is no such situation with other mobile phone tests. So the development of Android is not good, fragmentation is too serious, each has its own characteristics.
Xiaomi Adnroid the use of suspended frames is prohibited by default, resulting in the development of suspended boxes that cannot receive events