Exit error exception in fragment

Source: Internet
Author: User

Start, also did not think oneself in use of fragment, on the habit has been used fragment, do not know, in fact, I also think he has a lot of shortcomings I did not solve, to tell the truth ... Hey....

The state has been stored in the past. The results result in duplicate builds. Just click the Back button and always return to the previous page. This is particularly unscientific. If it is all a one-page, it is inappropriate. So, here, I simply don't want this sentence: Fragmenttransaction.addtobackstack (null);

Hey..

Then also encountered at the time of exiting fragment Mainactivity{41951c90} is not currently in the Fragmentmanager .... This question ... Only to find that the commit here is a point of attention .... That is, between fragment switching, if there is no guarantee that each time the fragment in the storage state before the commit, we can use commit (); We still use Fragmenttransaction.commitallowingstateloss (), otherwise we will report an exception.

For the time being the first to write down this problem, too much about the summary of things, I usually do not love to get. It's not good.

Exit error exception in fragment

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.