Android code optimizer, main interface stuck

Source: Internet
Author: User

============ Problem Description ============


Program opened into mainactivity, in fact Mainactivity did not do what operation, Mainactivity is loaded sildingmenu+actionbar+fragment, the specific business operation is carried out in fragment, But the program will show in mainactivity there mainactivity XML, in fact, nothing, but will stay about 1-5 seconds, just to show fragment XML, it feels strange, if the card will also be stuck in fragment there, The result fragment again not card, still stuck in mainacitivity there
Ask if there is any solution not, such as write a process animation, but how to monitor fragment loaded well

============ Solution 1============


Without a similar situation, if the business card, asynchronous processing can be, not to plug the UI thread.
Will you perform a lot of calculations at fragment initialization time? If you have code, you can analyze it.

============ Solution 2============


Preliminary estimates
You this imitation of QQ
Left is menu fragment, right is set fragment

1 Turn off the replace operation of these two fragment first. Look at the effect.
2 Postpone the construction of these two fragment until after the main interface is generated.

============ Solution 3============


I have updated the latest SDK and Eclipse in the last two days, and then when debugging the special card, a release package is no problem ~

============ Solution 4============


Reference 6 floor Heaimnmn's reply:
Quote: Quote 4 floor DAVIDLEEN29 reply:

Preliminary estimates
You this imitation of QQ
Left is menu fragment, right is set fragment

1 Turn off the replace operation of these two fragment first. Look at the effect.
2 Postpone the construction of these two fragment until after the main interface is generated.
The 2nd is not very clear, the structure sequence is mainactivity-> left fragment-> to the right of the fragmnet, how to postpone to the main interface after the generation of execution, the main interface is actually the right fragment


There's an interface.

I mean, if a fragment doesn't show up right away, you can postpone it postdelay a similar method (replace)
Personal thoughts, not to blame.

Android code optimizer, main interface stuck

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.