Android当启动应用程序时会显示白屏几秒钟吗? [英] Android When App is started shows white screen for few seconds?

查看:275
本文介绍了Android当启动应用程序时会显示白屏几秒钟吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尚未调用任何网址请求,该应用程序显示了一个简单的启动屏幕. 我也禁用了即时运行,但该警告仍然发生.

I have not called any Url request the app shows a simple splash screen. I have disabled the instant run too but that warning still occurs.

06-26 09:26:05.022 8709-8709/saurav.com.navigation_drawer I/art:后期启用-Xcheck:jni

06-26 09:26:05.022 8709-8709/saurav.com.navigation_drawer I/art: Late-enabling -Xcheck:jni

06-26 09:26:05.144 8709-8709/saurav.com.navigation_drawer W/系统:ClassLoader引用的未知路径:/data/app/saurav.com.navigation_drawer-1/lib/arm

06-26 09:26:05.144 8709-8709/saurav.com.navigation_drawer W/System: ClassLoader referenced unknown path: /data/app/saurav.com.navigation_drawer-1/lib/arm

06-26 09:26:15.383 8709-8709/saurav.com.navigation_drawer W/系统:ClassLoader引用的未知路径:/data/app/saurav.com.navigation_drawer-1/lib/arm

06-26 09:26:15.383 8709-8709/saurav.com.navigation_drawer W/System: ClassLoader referenced unknown path: /data/app/saurav.com.navigation_drawer-1/lib/arm

推荐答案

应用启动时,它首先使用启动活动的主题来显示窗口背景.有关该过程的完整说明,请参见 Android Deevelopers博客.如果未在 styles.xml 中指定 windowBackground ,则会使用默认的白色,并且会损坏UX.您可以在那里指定一个更令人愉悦的可绘制对象.

When your app starts, it first uses the theme of the launching activity to display the window background. Full explanation of the process can be found in Android Deevelopers Blog. If you don't specify windowBackground in your styles.xml, the default white will be used, and damage the UX. You can specify a more pleasing drawable there.

一种替代方法是造成一种幻想,即您的应用程序立即启动,并将责任归咎于启动器.您所需要做的就是为启动活动选择透明的windowBackground:

An alternative is to create an illusion that your app starts instantly, and put the blame on launcher. All you need is choose transparent windowBackground for the launching activity:

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="android:windowBackground">@dnull</item>
</style>

视觉结果是,最终用户按下应用程序的图标后,同一启动器屏幕将显示几秒钟,然后您的活动将全速进行.

The visual result will be that after the end user have pressed your app's icon, the same launcher screen is displayed for few seconds, and then your activity comes in at full speed.

无论如何,您应该分析应用程序的启动过程,并使其尽快运行,将可以推送到此处的所有内容推送到一个或多个后台线程.

At any rate, you should analyze the startup process of your app and make it as fast as possible, pushing to a background thread (or threads) everything that can be pushed there.

显示启动画面(即在应用程序逻辑在后台启动时加载非常快并保持吸引眼球的活动)是在所有平台上缓慢启动的常见解决方法,不仅限于Android.官方设计指南不鼓励这样做,但是许多受欢迎的应用程序(包括Google自己的应用程序)确实使用了初始屏幕.

Displaying a splash screen (i.e. and activity that loads very quickly and keeps the eyes attracted to it while the application logic is starting in the background) is the common cure for slow start on all platforms, not only Android. The official design guidelines discourage this, but many popular apps, including ones from Google herself, do use splash screens.

请参见 https://www.bignerdranch.com/blog/详情请参见.

PS 的确,对ClassLoader的此类警告通常是不相关的.

PS It's true that such warnings for ClassLoader are usually irrelevant.

这篇关于Android当启动应用程序时会显示白屏几秒钟吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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