Issue
I am wondering if one can load a library and declare/call native functions in a class other than an Activity. The reason why I am asking is because the way my application is structured, I have a separate static class which holds all of the information for all of my different Activites. Similar to using the Singleton method.
Right now I have my initial Activity always staying open, and other Activities calling the native methods from that first Activity. Is it possible for me to add all of the native methods to the static class, so I can close my initial Activity when I leave it?
public class StaticClass {
static {
System.loadLibrary( "NativeLibrary" );
}
// I also am not sure if the static modifier goes before or after native.
public native static void nativeVoidMethod();
}
Solution
Yes, it is completely possible.
Answered By - JuiCe
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.