
Things work perfectly for most of the times, but for few users it is crashing on builder.show() and I can see "$BadTokenException: Unable to add window" from crash log. After dismissing it, when the OK button is pressed, forward to Google Play for purchase. Setting the extra height solves the issue.From my main activity, I need to call an inner class and in a method within the class, I need to show AlertDialog.

The main problem was when we set the parameters to match_parent, it sets to the height of screen minus the nav bar I suppose. Setting the extra height required to be covered behind soft keys. TYPE_SYSTEM_OVERLAY (or any similar types) which can show content over the whole screen.įLAG_LAYOUT_NO_LIMITS which allows us to go over the normal size allowed. WindowManager.addView(frameLayout, params)

make sure height includes the nav bar size (get the dimension of whole screen) WindowManager.LayoutParams params = new WindowManager.LayoutParams( WindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE) Here's a small example which works: FrameLayout frameLayout = new FrameLayout(context) įtBackgroundColor(Color.BLACK) WindowManager.addView(view_floating, paramsRL) What should I do to acomplish it?(make overlay including nav bar area) final WindowManager.LayoutParams paramsRL = new WindowManager.LayoutParams( Here's my code to add a view fills whole screen except nav bar area. those permissions are granted for system apps only. It requires INTERNAL_SYSTEM_WINDOW OR something more undocumented than SYSTEM_ALERT_WINDOW. I applied these to my app but got crashe says permission denied.

TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21 TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19 I looked down the source code of Android, found interesting that has more types undocumented. Transition HALs to use AIDL exclusively where possible (when upstream HALs use HIDL, HIDL must be used).

This makes it possible to implement parts of Android without HIDL. I did replacing MATCH_PARENT to 9999 but it still won't overlays nav bar area. Android 11 introduces the ability to use AIDL for HALs in Android. It looks good however it won't overlays nav bar area. In general, this makes a view overlays on top of lock screen. So I looked down smali codes from Lumens apk(sorry chainfire), found 0x7d6 as type specifier, which is TYPE_SYSTEM_OVERLAY. I just remembered this is NOT POSSIBLE on general approach and many SO answers told me. it's CF.Lumen(requires android 4.4+) by chainfire. I saw an app that overlays whole screen including nav bar (or soft-key that has back, home, etc.) today. AndroidAndroid AndroidWindowPhoneWindowDecorViewsetContentView AndroidWindowWindowManagerActivity AndroidViewRootImplViewWindowManager AndroidWindowManager.
