简体   繁体   English

Android启动画面和异步

[英]Android splash screen and async

When creating a splash screen for an Android app, does the code that runs while the splash screen is visible need to be asynchronous? 在为Android应用创建启动画面时,在启动画面可见时运行的代码是否需要异步? If so, why? 如果是这样,为什么? Thanks. 谢谢。

Yes, otherwise your splash image will never show until the code completes. 是的,否则在代码完成之前,您的启动图像将永远不会显示。 Because Android has the single UI thread. 因为Android具有单个UI线程。 If you do anything else in that UI thread then no UI changes are possible until your other code finishes. 如果您在该UI线程中执行其他任何操作,则在其他代码完成之前,无法更改UI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM