Skip to content
Browse files

FIX: [droid] catch UnsatisfiedLinkErrors when invoking native

  • Loading branch information...
1 parent 8c3a58d commit 48298e1e93b2965097dbd0fcded1656595dd490c @koying koying committed Dec 1, 2013
View
8 tools/android/packaging/xbmc/src/org/xbmc/xbmc/Main.java
@@ -3,10 +3,12 @@
import android.app.NativeActivity;
import android.content.Intent;
import android.os.Bundle;
+import android.util.Log;
public class Main extends NativeActivity
{
native void _onNewIntent(Intent intent);
+
public Main()
{
super();
@@ -22,7 +24,11 @@ public void onCreate(Bundle savedInstanceState)
protected void onNewIntent(Intent intent)
{
super.onNewIntent(intent);
- _onNewIntent(intent);
+ try {
+ _onNewIntent(intent);
+ } catch (UnsatisfiedLinkError e) {
+ Log.e("Main", "Native not registered");
+ }
}
}
View
6 tools/android/packaging/xbmc/src/org/xbmc/xbmc/XBMCBroadcastReceiver.java
@@ -13,6 +13,10 @@
public void onReceive(Context context, Intent intent)
{
Log.d("XBMCBroadcastReceiver", "Received Intent");
- _onReceive(intent);
+ try {
+ _onReceive(intent);
+ } catch (UnsatisfiedLinkError e) {
+ Log.e("XBMCBroadcastReceiver", "Native not registered");
+ }
}
}

0 comments on commit 48298e1

Please sign in to comment.
Something went wrong with that request. Please try again.