The variable scale is equal to 1.78, but for some reason the condition does not work, how to make a comparison correctly?
B4X:
Sub Process_Globals
Public scale As Double = Round2(GetDeviceLayoutValues.Height / GetDeviceLayoutValues.Width, 2) 'ignore
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
#if Java
import android.content.*;
import android.content.res.*;
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
final Configuration override = new Configuration(newBase.getResources().getConfiguration());
if (override.fontScale > 1.0f) {
override.fontScale = 1.0f;
}
if (_scale != 1.78) {
override.fontScale = 0.8f;
}
applyOverrideConfiguration(override);
}
#End If
End If
End Sub