Browse files

droid: Only load from the first loaded java class

  • Loading branch information...
1 parent f871f79 commit ca93bec13a4bcc214cec032efa2f5218ce2c9fcf Cory Fields committed Mar 6, 2013
@@ -31,6 +31,11 @@
public class Splash extends Activity {
+ static
+ {
+ System.loadLibrary("xbmc");
+ }
public enum State {
Uninitialized, InError, Checking, Caching, StartingXBMC
@@ -7,10 +7,6 @@
public class XBMCBroadcastReceiver extends BroadcastReceiver
native void ReceiveIntent(Intent intent);
- static
- {
- System.loadLibrary("xbmc");
- }
public void onReceive(Context context, Intent intent)

2 comments on commit ca93bec


koying replied Mar 29, 2013

That doesn't work.
I get
`E/AndroidRuntime( 785): java.lang.UnsatisfiedLinkError: Native method not found: org.xbmc.xbmc.XBMCBroadcastReceiver.ReceiveIntent:(Landroid/content/Intent;)V``
when the receiver is actually invoked simply because the intent is recived, whether xbmc is launched or not.
As is never loaded, JNI_OnLoad is not called, neither is CAndroidJNIManager::Load, thus neither CAndroidJNIManager::RegisterClass and CBroadcastReceiver is not even instanciated.


theuni replied Mar 29, 2013

This is racy, and probably doing different things on different devices. It will depend on the entry-point (clicking xbmc icon vs auto-start vs media handler). But you are certainly correct that it's busted in general.

As mentioned in your PR, i have a rewrite that addresses the bigger JNI issues. Sorry for all the back/forth on this stuff, hopefully we're closing in on a working solution :)

Please sign in to comment.