Reputation: 41
I am using NativeActivity and have setup and exported JNI_OnLoad
in the shared library. But the JNI_OnLoad
is not getting called !
Upvotes: 0
Views: 12
Reputation: 41
No, JNI_OnLoad()
wont work for the library called from NativeActivity (Credit). Instead, I guess ANativeActivity_onCreate()
compensate for it.
As seen in android source, NativeActivity
does not call System.loadLibrary()
but calls loadNativeCode()
which does dlopen()
directly.
I had to use RegisterNatives()
which could just as well be called in ANativeActivity_onCreate()
.
Android Dev is fun /s
Upvotes: 1