Android Question Go back to default view from immersive mode


Active Member
Licensed User
Longtime User
I know the following code can take an app into immersive mode. But what is the code to go back to the default view so it's not in immersive mode? I want to switch between the two. Thanks.

Dim p As Phone
If p.SdkVersion >= 28 Then
    Dim ctxt As JavaObject
    ctxt.RunMethodJO("getWindow", Null).RunMethodJO("getAttributes", Null).SetField("layoutInDisplayCutoutMode", 1)
End If
Dim lv As LayoutValues = GetRealSize
Dim jo As JavaObject = Activity
jo.RunMethod("setBottom", Array(lv.Height))
jo.RunMethod("setRight", Array(lv.Width))
Activity.Height = lv.Height
Activity.Width = lv.Width

Dim jo As JavaObject = Activity
jo.RunMethod("setSystemUiVisibility", Array As Object(5894))