![]() GetHeight () params.x = 0 params.y = 0 windowmanager.addview (Contentview, params) //Contentview need to define their own, and the addition of suspended windows need to dynamically apply for suspended window permissions.I came to find a a solution to this problem 2 hours after you posted the solution. GetWidth () p arams.height = Windowmanager.getdefaultdisplay (). ![]() WindowManager WindowManager = (windowmanager) getsystemservice (Window_service) Windowmanager.layoutparams params = new windowmanager.layoutparams () p Arams.type = _phone params.format = pixelformat.rgba_8888 avity = Gravity.LEFT | Gravity.top params.flags = _not_focusable params.width = Windowmanager.getdefaultdisplay (). Here is the code for adding the suspended window, for reference only: The mistake, specifically means that toast has been added to the window, so this time we can change the type_toast to Type_phone, so that you can display the suspended window, the program will not crash. However, after the system upgrade Android7.0, it will be reported $badtokenexception:unable to add Window-window has Already been added Params.type = Windowmanager.layoutparams. windowmanager$badtokenexception: Unable to add window-window have already been added at (view rootimpl.java:691) at (windowmanagerglobal.java:342) at (windowmanagerimpl.java:94) at $tn.handleshow ( toast.java:434) at $tn$2.handlemessage (toast.java:345) at Android.os.Handler.dispatchMessage ( handler.java:102) at Android.os.Looper.loop (looper.java:154) at ( activitythread.java:6119) at .invoke (Native Method) at .zygoteinit$ n (zygoteinit.java:886) at .ZygoteInit.main (zygoteinit.java:776)įrom the error message, I came to the conclusion that:īefore Android6.0, using WindowManager to add a suspended window, the type of suspension I used was type_toast, i.e. ![]() ![]() ![]() Long before the test passed the code, now the phone upgraded Android7.0 after a run on the crash, reported such errors, the specific error is as follows: Tag: CTI Manager flags application for OOP view RGBA logs RAS ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |