============ 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