Implementation code of Android cold start app on in seconds

This paper introduces the implementation code of Android cold start to realize app on in seconds, which is shared with you as follows:

Add the attribute Android: theme = "@ style / appsplash" to the corresponding activity in androidmanifest

@style/AppSplash:

@drawable/splash:

This is OK. Of course, this is just a feeling for users, not really "second open" app.

When an activity is opened, if the application to which the activity belongs has not been started, the system will create a process for the activity. The process creation and initialization will take some time. During this time, WindowManager will first load the window background in the topic style in the app as the preview element, Then go to the real loading layout. What I did above is to present the launched interface to the user as a preview element in the window background configuration of style.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>