createApplication() in IOSLauncher gets run twice

Anything libgdx related goes here!

createApplication() in IOSLauncher gets run twice

Postby portfort » Mon Feb 11, 2019 7:50 am

Why would this happen?

Here's my IOSLauncher without the methods I added:
Code: Select all
public class IOSLauncher extends IOSApplication.Delegate implements IActivityRequestHandler {
    private static IOSLauncher application;
    @Override
    protected IOSApplication createApplication() {
        IOSApplicationConfiguration config = new IOSApplicationConfiguration();
        config.orientationPortrait = true;
        config.orientationLandscape = false;
        config.preventScreenDimming = true;
        GADMobileAds.disableSDKCrashReporting();
        return new IOSApplication(new HLgame(application), config);
    }

    public static void main(String[] argv) {
        if (application==null) {
            application = new IOSLauncher();
        }
        NSAutoreleasePool pool = new NSAutoreleasePool();
        UIApplication.main(argv, null, IOSLauncher.class);
        pool.close();
    }
}


Edit: it stopped happening but I don't think I changed anything. createApplication() was 100% being called twice along with my main game class and it happened maybe 20 times (every time I recompiled and started the game) before it stopped. Weird.
portfort
 
Posts: 52
Joined: Fri May 16, 2014 8:20 am

Re: createApplication() in IOSLauncher gets run twice

Postby tomski » Mon Feb 11, 2019 1:13 pm

Code: Select all
        if (application==null) {
            application = new IOSLauncher();
        }


Why have you added this?
tomski
 
Posts: 839
Joined: Wed Jun 26, 2013 6:06 pm

Re: createApplication() in IOSLauncher gets run twice

Postby portfort » Tue Feb 12, 2019 5:15 am

tomski wrote:
Code: Select all
        if (application==null) {
            application = new IOSLauncher();
        }


Why have you added this?

Uhh...no idea. It was 2 years ago, probably something wasn't working right so I was trying different things and forgot to undo. Do you think it could have something to do with createApplication() running twice? And why is it not doing any more even with that code still there.
portfort
 
Posts: 52
Joined: Fri May 16, 2014 8:20 am


Return to Libgdx

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest