如何设置启动画面的时间限制?

Nei*_*eil 0 eclipse android splash-screen

我正在 Eclipse 中为 Android 应用程序编码。我开发了一个闪屏,我需要在我的应用程序启动前显示 5 秒。怎么做?

Dee*_*pzz 6

       Thread timer=new Thread()
        {
            public void run() {
                try {
                    sleep(2000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                finally
                {
                    Intent i=new Intent(SplashScreen.this,MainActivity.class);
                    finish();
                    startActivity(i);
                }
            }
        };
        timer.start();
Run Code Online (Sandbox Code Playgroud)