diff options
author | Sven Gothel <[email protected]> | 2012-05-03 05:02:08 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-03 05:02:08 +0200 |
commit | 3a63e20ca981931ed42d27a7ce4c6b16c9198020 (patch) | |
tree | 17ac96b1d06d3b312684cb411bc00de2edaea9e5 /src/java/jogamp/android/launcher/ActivityLauncher.java | |
parent | 4ce601b38ca8418eddbe8cca4d531e6161fae26b (diff) |
AndroidLauncher: Add 'MainLauncher'; ClassLoaderUtil adds list of direct APKs to add to classpath
MainLauncher is capable of launching a traditional static main method from a activity.
TODO:
- parametrize the APK list (junit, ..)
- pass-through the activity instance to be used w/ NEWT AndroidWindow
Diffstat (limited to 'src/java/jogamp/android/launcher/ActivityLauncher.java')
-rw-r--r-- | src/java/jogamp/android/launcher/ActivityLauncher.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/java/jogamp/android/launcher/ActivityLauncher.java b/src/java/jogamp/android/launcher/ActivityLauncher.java index 7506803..bd7c723 100644 --- a/src/java/jogamp/android/launcher/ActivityLauncher.java +++ b/src/java/jogamp/android/launcher/ActivityLauncher.java @@ -34,17 +34,17 @@ import java.lang.reflect.Method; import android.app.Activity; import android.net.Uri; import android.os.Bundle; -import android.widget.TextView; import android.util.Log; public class ActivityLauncher extends Activity { static final String TAG = "JogAmp-ActivityLauncher"; - TextView tv = null; + + LauncherUtil.DataSet data = null; + + Class<?> activityClazz = null; Method mOnCreate, mOnDestroy, mOnPause, mOnRestart, mOnResume, mOnStart, mOnStop, mSetRootActivity; - Class<?> activityClazz = null; Object activityObject = null; - LauncherUtil.DataSet data = null; @Override public void onCreate(Bundle savedInstanceState) { @@ -55,13 +55,11 @@ public class ActivityLauncher extends Activity { data = LauncherUtil.DataSet.create(uri); data.setSystemProperties(); - ClassLoader cl = ClassLoaderUtil.createClassLoader(this, data.getPackages(), false); + ClassLoader cl = ClassLoaderUtil.createClassLoader(this, data.getPackages(), false, null); if(null != cl) { try { activityClazz = Class.forName(data.getActivityName(), true, cl); Log.d(TAG, "Activity Clazz "+activityClazz); - activityObject = createInstance(activityClazz, null); - Log.d(TAG, "Activity Object "+activityObject); mOnCreate = activityClazz.getMethod("onCreate", Bundle.class); mOnDestroy = activityClazz.getMethod("onDestroy"); mOnPause = activityClazz.getMethod("onPause"); @@ -70,6 +68,8 @@ public class ActivityLauncher extends Activity { mOnStart = activityClazz.getMethod("onStart"); mOnStop = activityClazz.getMethod("onStop"); mSetRootActivity = activityClazz.getMethod("setRootActivity", Activity.class); + activityObject = createInstance(activityClazz, null); + Log.d(TAG, "Activity Object "+activityObject); } catch (Exception e) { Log.d(TAG, "error: "+e, e); throw new RuntimeException(e); |