I´m getting this error when raising an event in b4a from a library.
the sub is declared in b4a-project
Can anybody give any hint of what i´m doing wrong here?
SyncStatusListener added
ba.subExists(datastore_onstatuschange)
found.. Raising.. datastore_onstatuschange
java.lang.Exception: Sub datastore_onstatuschange signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:177)
at anywheresoftware.b4a.BA$3.run(BA.java:320)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
java.lang.Exception: Sub datastore_onstatuschange signature does not match expected signature.
B4X:
@ShortName("DbxDatastore")
@Events(values={"onstatuschange(ds As DbxDatastore)"})
public static class DbxDatastoreWrapper extends AbsObjectWrapper<DbxDatastore> {
private SyncStatusListener listener;
private String eventName;
public void startListening(final BA ba, String EventName) {
//SensorManager sm = (SensorManager) ba.context.getSystemService(Context.SENSOR_SERVICE);
eventName = EventName.toLowerCase(BA.cul);
final String s = EventName.toLowerCase(BA.cul) + "_onstatuschange";
listener = new SyncStatusListener() {
@Override
public void onDatastoreStatusChange(DbxDatastore ds){
//BA.Log("Event onStatusChange raised in Library");
BA.Log("ba.subExists("+eventName + "_onstatuschange"+")");
if (ba.subExists(eventName + "_onstatuschange")) {
BA.Log("found.. Raising.. "+eventName + "_onstatuschange");
ba.raiseEventFromDifferentThread(null, null, 0, eventName+"_onstatuschange", true, new Object[] {ds});
} else {
BA.Log("NOTFOUND '"+eventName + "_onstatuschange");
}
//ba.raiseEventFromDifferentThread(null, null, 0, eventName + "_onDatastoreStatusChange", true, new Object[] {ds});
//BA.Log("Raising: "+s);
//ba.raiseEvent(ba, s, ds);
}
};
getObject().addSyncStatusListener(listener);
BA.Log("SyncStatusListener added");
}
public void stopListening(final BA ba, String EventName) {
getObject().removeSyncStatusListener(listener);
BA.Log("SyncStatusListener removed");
}
the sub is declared in b4a-project
B4X:
Sub datastore_onstatuschange(ds As DbxDatastore)
End Sub
Can anybody give any hint of what i´m doing wrong here?