Android Question lv.ApproximateScreenSize return value

Scantech

Well-Known Member
Licensed User
Longtime 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
Longtime 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.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Upvote 0

klaus

Expert
Licensed User
Longtime 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.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…