Android Question lv.ApproximateScreenSize return value

Scantech

Well-Known Member
Licensed User
logging lv.ApproximateScreenSize returns "NaN" with 10inch emulator. what is NaN? Should it return a number instead of NaN?
 

Scantech

Well-Known Member
Licensed User
Oops.

My code was
B4X:
    Dim lv As LayoutValues
Should be
B4X:
    Dim lv As LayoutValues
    lv = GetDeviceLayoutValues
Now it works good.

but i spotted some kind of bug(not using lv = GetDeviceLayoutValues). If statement being true was based on log being added or not. I will create a new thread for this. This is probably another bug i spotted.
 

udg

Expert
Licensed User

klaus

Expert
Licensed User
You can replace:
B4X:
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
simply by this, as DonManfred already showed:
B4X:
GetDeviceLayoutValues.ApproximateScreenSize
You can use GetDeviceLayoutValues directly, no need to Dim a LayoutValues object.
 
Top