@yglukhov, thanks, it was helpful. For most cases the functionality of java 
interface implementation works.

But in some cases I get error at runtime:

java_vm_ext.cc:504] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called 
with pending exception java.lang.NullPointerException: Expected to unbox a 
'boolean' primitive type but was returned null

java_vm_ext.cc:504] at boolean java.lang.Object.equals(java.lang.Object) 
((null):-1)
    java_vm_ext.cc:504] at int 
java.util.concurrent.CopyOnWriteArrayList.indexOf(java.lang.Object, 
java.lang.Object[], int, int) (CopyOnWriteArrayList.java:196) 
java_vm_ext.cc:504] at boolean 
java.util.concurrent.CopyOnWriteArrayList.contains(java.lang.Object) 
(CopyOnWriteArrayList.java:232)...
    
    
    let prGstr = makeProxy(SomeListenerInterface, mr, MyObj_dispatcher)
    mGstr.addOnSomeListener(prGstr, 10,  true.jboolean) #<-here runtime 
exception
    

and I have another question: I tried to implement this:
    
    
    import asyncdispatch
    
    proc callAsync() {.async.} =
        await sleepAsync(1)
        android_log_write(4, "TEST", "async wait")
    discard callAsync()
    waitFor callAsync()
    

this works as expected I get two "async wait" in the log. But if I set comment 
for waitFor callAsync() like this: 
    
    
    import asyncdispatch
    
    proc callAsync() {.async.} =
        await sleepAsync(1)
        android_log_write(4, "TEST", "async wait")
    discard callAsync()
    #waitFor callAsync()
    

or if run the discard callAsync() in callback of events then nothing is coming 
to the log. But I think it is nothing to do with JNI on android?

thanks 

Reply via email to