问一个初级问题,
我想给自己的应用加一个启动界面,停滞3秒,如何实现?

解决方案 »

  1.   

    http://item.taobao.com/item.htm?id=10224708560,这里有大量的开发资料,你可以看看有没有你需要的
      

  2.   

    用一个UIController类来控制吧,将它的Intent给跳转到你所想要的界面上,然后再进行操作
      

  3.   

    int main(int argc, char *argv[]) {
    QApplication a(argc, argv);
    a.connect(&a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );// added test for player// The splash screen
    QSplashScreen *pSplash = new QSplashScreen();
    pSplash->setPixmap(QPixmap(":images/Splash.png"));
    pSplash->show();
    pSplash->showMessage("Start ...");// main window
    MainWindow w;
    w.setWindowTitle(QObject::tr(" my title"));
    w.hide();// mainwindow disappearsQTimer::singleShot(3000, pSplash, SLOT(close()));// close splash after 4s
    QTimer::singleShot(3000, &w, SLOT(slInit()));// mainwindow reappears after 4s
    // create DataBase.
    pSplash->showMessage("Initialise the Database...");// shows comments
    w.databaseobject-> createPlayListTables(); // DB created but need another object in mainwindow!!pSplash->showMessage("load data...");
    w.loadProgamListFromDB(); //load data to applicationreturn a.exec();}
      

  4.   

    public class SplashActivity extends Activity { @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);

    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {

    @Override
    public void run() {
    Intent intent  = new Intent(SplashActivity.this,MainActivity.class);
    startActivity(intent);
    finish();
    }
    }, 3000);
    }

    }这介一种方式,新浪微薄貌似就这样做的。