Splash Window

To control the close of Splash Window


Introduction

To integrate with Splash Window is not necessary.

What you can do through integration is to control the close of Splash Window. If you don't control the Splash Window, it will automatically close when first window opens if it is enabled at step 3[since 2.0.6], or it will automatically close in a short time.


API Class

There is one class to integrate with Splash Window:

public class SplashScreen
{
    /**
     * Get the Splash Screen instance
     */
    public static SplashScreen getSplashScreen();

    /**
     * To auto-close after milli-seconds, if msec < 0, auto-close is disabled
     */
    public void autoClose(int msec);

    /**
     * Close the splash screen
     */
    public void close();
}

Demo Code

To let the Splash Window close after a period of time:

// Get instance
SplashScreen splash = SplashScreen.getSplashScreen();

// Set a auto close time
if(splash != null) splash.autoClose(3000); 

To disable auto close, and then close at a moment:

// Get instance
SplashScreen splash = SplashScreen.getSplashScreen();

// Disable auto close
if(splash != null) splash.autoClose(-1);

// ......

// Close
if(splash != null) splash.close();

See Also

Add new comment