Android Question AsyncStreamsObject send Map that become a MyMap, Why?

TheMightySwe

Active Member
Licensed User
Longtime User
This is the map I send.

B4X:
        Dim NewClient As Map
        NewClient.Initialize
        NewClient.Put("id",ID)
        PosNrCount = SQL.RegisterQuerySingleResultAsInteger("SELECT COUNT(id) AS Counted FROM pos WHERE software_type = 'register'")
        PosNrCount = PosNrCount + 1

        NewClient.Put("posnr",PosNrCount)
        NewClient.Put("name", "Kassa " & PosNrCount)
       
        SQL.RegisterUpdateFromMap(NewClient,"pos")
       
        CallSubDelayed3(Main,"SendDataToClient","NewRegisterRegistered",NewClient)

On the other side this is the code.

B4X:
Sub ASO_Client_NewObject(Key As String, Value As Object)

    If Debug = True Then Log("ASO_Client_NewObject(Key=" & Key & ")")
    If Debug = True Then Log(Value)

    Dim Data As Map
    Data.Initialize
    Data = Value  <---- Error occur

java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map cannot be cast to anywheresoftware.b4a.objects.collections.Map$MyMap
at se.iqpd.checkout.plus.main._aso_client_newobject(main.java:3077)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:882)
at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:847)
at se.iqpd.checkout.plus.asyncstreamsobject._astream_newstream(asyncstreamsobject.java:275)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)


So have anyone any idea how to solve this?

// TMS
 
Top