Android应用程序的载入画面 [英] Android application loading screen

查看:105
本文介绍了Android应用程序的载入画面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,使用一个ListActivity列出了存储库的应用程序。

I'm working on an application that lists a stored library using a ListActivity.

我的问题是,当我打开应用程序它有一个明显的加载时间XML视图充气之前。在此期间,仅在应用程序名称被示出。这是明显的在相当多的应用程序在那里,但其他人似乎有实施的加载屏幕,什么不是。

My question is, is when I open application it has a visible loading time before the XML view is inflated. During this time only the application name is shown. This is noticeable on quite a few application out there but others seem to have implemented loading screens and what not.

没有任何人有一个解决的办法或不知道如何使一个很好的加载屏幕?

Does anyone have a solution to this or know how to make a good loading screen?

干杯!

推荐答案

如果你的活动正在超过一对夫妇十分之一秒启动的,你正在做的工作太多的的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.

这篇关于Android应用程序的载入画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆