且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android应用程序的载入画面

更新时间:2023-01-26 08:44:00

如果你的活动正在超过一对夫妇十分之一秒启动的,你正在做的工作太多的的onCreate( ) ONSTART() onResume()。此举工作提高到一个后台线程,可能使用的AsyncTask

If your activity is taking more than a couple of tenths of a second to start up, you are doing too much work in onCreate(), onStart(), or onResume(). Move that work to a background thread, perhaps using AsyncTask.

然后,如果你想要做的事,而后台线程运算的时候,你可以使用 ProgressDialog ,或致电的setContentView()多次(最初有闪屏,然后再与完整的UI,一旦后台工作完成后),或什么的。

Then, if you want to do something while the background thread is crunching away, you can use a ProgressDialog, or call setContentView() multiple times (initially with a splash screen, then later with the full UI once the background work is done), or whatever.