Android Question Display interface error occurs after full screen advertising

mywmshow

Member
Sorry, I use the translator, hoping to clarify my question
My app originally worked fine, but as long as a third-party full-screen advertisement was displayed, the app would be misaligned. What can I do to resolve this!
My app is in Activity_ The setup code used in Create is as follows:
B4X:
#if JAVA
public void setToumingtitle() {
    Window window = getWindow();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
        window.setStatusBarColor(Color.TRANSPARENT);
        
        View decorView = window.getDecorView();
        int systemUiVisibility = decorView.getSystemUiVisibility();
        systemUiVisibility &= ~View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
        decorView.setSystemUiVisibility(systemUiVisibility);

    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }
}
#end if
Thank you very much for your help!
 

Attachments

  • 就是这样的启动开屏广告.jpg
    就是这样的启动开屏广告.jpg
    31.6 KB · Views: 106
  • 展示广告后高度错位.jpg
    展示广告后高度错位.jpg
    45.1 KB · Views: 110
  • 不开启广告一切正常.jpg
    不开启广告一切正常.jpg
    47.4 KB · Views: 111

mywmshow

Member
Found the reason, is caused by 100% y to get to the height of the error
Right to obtain highly code is as follows:

B4X:
    Dim jo As JavaObject
    jo.InitializeContext
    jo= jo.RunMethod("getResources", Null)
    jo=jo.RunMethod("getDisplayMetrics", Null)
    mainheight =jo.GetField("heightPixels")
 
Upvote 0
Top