paulirotta / Tantalum

Tantalum Cross Platform Library
12 stars 6 forks source link

init() call missing from setProgram for Android #40

Closed vivainio closed 11 years ago

vivainio commented 11 years ago

We should call init() for Android init sequence as well:


        try {
            if (Class.forName("android.app.Activity").isAssignableFrom(program.getClass())) {
                platform = PLATFORM_ANDROID;
                platformAdapter = (PlatformAdapter) Class.forName("org.tantalum.android.AndroidPlatformAdapter").newInstance();
                init(logMode); // <=== MISSING
                return;
            }
        } catch (Throwable t) {
            System.out.println("Can not init Android in setProgram(" + program.getClass().getName() + ") : " + t);
        }
        try {
            if (Class.forName("javax.microedition.midlet.MIDlet").isAssignableFrom(program.getClass())
                    || program.getClass().getName().toLowerCase().indexOf("test") > 0) {
                platform = PLATFORM_JME;
                platformAdapter = (PlatformAdapter) Class.forName("org.tantalum.jme.JMEPlatformAdapter").newInstance();
                init(logMode);
                return;
            }
        } catch (Throwable t) {
            System.out.println("Can not init JME in setProgram(" + program.getClass().getName() + ") : " + t);
        }
paulirotta commented 11 years ago

done, thanks!