Bug? B4A-Bridge - Crash in function isNightMode

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

I had to put a try catch in this function as is fails on a new device we got from china. Just thought you should know.

B4X:
Sub IsNightMode As Boolean
    Dim ctxt As JavaObject
    Try 
        ctxt.InitializeContext
        Log(ctxt.RunMethodJO("getResources", Null).RunMethodJO("getConfiguration", Null).GetField("uiMode"))
        Return Bit.And(ctxt.RunMethodJO("getResources", Null).RunMethodJO("getConfiguration", Null).GetField("uiMode"), 0x30) = 0x20
    Catch
        Return False
    End Try
End Sub

Regards

John.
 

DonManfred

Expert
Licensed User
Longtime User

Jmu5667

Well-Known Member
Licensed User
Longtime User
java.lang.ClassNotFoundException: Didn't find class "android.content.res.XResources" on path: DexPathList[[zip file "/data/app/anywheresoftware.b4a.b4abridge-1/base.apk"],nativeLibraryDirectories=[/data/app/anywheresoftware.b4a.b4abridge-1/lib/arm, /vendor/lib, /system/lib]]
 
Top