App launch optimization, resolve blank pages or lag too long

Source: Internet
Author: User

don't say much nonsense, first of all the reasons, application to execute too many instructions, start page start will be executed before related methods of application . 
OK, the reason is finished, as to how to optimize, then go to the degree, I say here is the launch of the app as soon as possible the start page.
such as the start page is guideactivity
  

<activity
android:name= ". Guideactivity "
android:screenorientation=" Portrait "
Android:theme=" @ Style/splashtheme ";
<intent-filter>
<action android:name=" Android.intent.action.MAIN " />

<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Style code:
<style name= "Apptheme.noactionbar" >
<item name= "Windowactionbar" >false</item>
<item name= "Windownotitle" >true</item>
<item name= "Android:windowfullscreen" >true</item>
</style>
<!--Base Application theme. -
<style name= "Splashtheme" parent= "Apptheme.noactionbar" >
<item name= "Android:windowbackground" > @drawable/logo_splash</item>
</style>
OK, end, so easy to optimize performance or change application better, this method is used in the optimization of the slow processing method
It is important to note that after you set the theme, you do not need to set the
Setcontentview (R.LAYOUT.ACTIVITY_GUID);
This can result in duplicate drawing, resulting in unnecessary waste of resources.


App launch optimization, resolve blank pages or lag too long

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.