...
Code Block | ||
---|---|---|
| ||
public static void Load() { String lib = ""; try { lib = "JNI"; System.loadLibrary(lib); } catch (UnsatisfiedLinkError use) { Log.e("JNI", "WARNING: Could not load JNI library " + lib, use ); } ... } |
6. Call the JNI method
Whenever you call a JNI method from the app part of your application, you need to run it from the working thread. The class CFxARESInstance provides the method runOnWorkingThread() for this purpose.
MainActivity.java
Code Block |
---|
private void SetBackground( @BackgroundColor final int color )
{
CFxARESInstance.instance().runOnWorkingThread(new Runnable()
{
@Override
public void run()
{
JNI.SetBackgroundColor( color );
}
});
} |