问一个初级问题,
我想给自己的应用加一个启动界面,停滞3秒,如何实现?
我想给自己的应用加一个启动界面,停滞3秒,如何实现?
解决方案 »
- Android4.0以上版本视频缩略图在哪里生成的?缩略图与文件之间的关联关系又存在哪里?
- [求助]GridView载入过慢问题
- 加入Android开发行列,过来推荐两个教学视频
- 怎样在activity中响应view类中的触屏事件?
- android访问Java接口404
- android开发--文件下载在手机报错
- 在ImageView中android:src怎么使用?请大神帮忙
- error opening trace file: No such file or director
- TextView在有多行文本的情况下怎么使每一行都居中对齐
- 视频讲解Android面试题【超清,不断更新】
- Android开发入手准备工作有哪些?
- 一个Android安装问题
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();}
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);
}
}这介一种方式,新浪微薄貌似就这样做的。