From fd98c6b8f0a9192c6ee8069a98600235abe9c2eb Mon Sep 17 00:00:00 2001 From: iwgeric Date: Tue, 3 May 2016 17:50:56 -0400 Subject: [PATCH] Improve some error handling on class name searching --- .../org/jmonkeyengine/jme3androidexamples/MainActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java b/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java index 965ea19f6..b4dc6f093 100644 --- a/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java +++ b/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java @@ -287,7 +287,7 @@ public class MainActivity extends AppCompatActivity implements OnItemClickListen private boolean checkClassType(String className) { boolean include = true; try { - Class clazz = (Class)Class.forName(className); + Class clazz = (Class) Class.forName(className); if (Application.class.isAssignableFrom(clazz)) { Log.i(TAG, "Class " + className + " is a jME Application"); } else { @@ -295,6 +295,9 @@ public class MainActivity extends AppCompatActivity implements OnItemClickListen Log.i(TAG, "Skipping Class " + className + ". Not a jME Application"); } + } catch (NoClassDefFoundError ncdf) { + include = false; + Log.i(TAG, "Skipping Class " + className + ". No Class Def found."); } catch (ClassNotFoundException cnfe) { include = false; Log.i(TAG, "Skipping Class " + className + ". Class not found.");