From 3a63e20ca981931ed42d27a7ce4c6b16c9198020 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 3 May 2012 05:02:08 +0200 Subject: 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 --- src/java/jogamp/android/launcher/ActivityLauncher.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/java/jogamp/android/launcher/ActivityLauncher.java') 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); -- cgit v1.2.3