Sub GetRealSize As LayoutValues
Dim lv As LayoutValues
Dim p As Phone
If p.SdkVersion >= 17 Then
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim display As JavaObject = ctxt.RunMethodJO("getSystemService", Array("window")).RunMethod("getDefaultDisplay", Null)
Dim point As JavaObject
point.InitializeNewInstance("android.graphics.Point", Null)
display.RunMethod("getRealSize", Array(point))
lv.Width = point.GetField("x")
lv.Height = point.GetField("y")
Else
lv.Width = 100%x
lv.Height = 100%y
End If
lv.Scale = 100dip / 100
Return lv
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim jo As JavaObject = Activity
jo.RunMethod("setSystemUiVisibility", Array As Object(5894)) '3846 - non-sticky
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
Activity.LoadLayout("Layout1")
End Sub