Android Question If Statement bug

Scantech

Well-Known Member
Licensed User
This is actually a bug i spotted with statement being true based on adding a log or not.

Try attached file.

Follow these steps

  1. Disable the log("THIS WILL TRIGGER TRUE STATEMENT")
  2. Run the app
  3. observe the Value (Value = "Im False Statement")

  1. Now, Enable the Log("THIS WILL TRIGGER TRUE STATEMENT")
  2. Run the app
  3. observe the Value (Value = "IM True Statement")

This is only caused by not using
lv = GetDeviceLayoutValues
Even if not using it, it should not cause statement issues as i observed.

There should be a warning message or something

MUST use with 10inch Emulator
 

Attachments

Last edited:

Erel

Administrator
Staff member
Licensed User
Moved to the questions forum.
It is not related to the log command or the if statement. Accessing an uninitialized LayoutValues object is a programming mistake. Your code causes a division by 0.

The difference in the behavior is related to the debugger pipeline. You can see it by cleaning the project after you make a change.

Anyway, I will make this method (ApproximateScreenSize) throw an exception when the Scale is zero.
 
Top