Android Learning 12 configuration changes

Source: Internet
Author: User

1. Configuration changes will terminate the current activity and rebuild the activity

2. Configuration Changes 2.1 screen direction change 2.2 language Changes 2.3 plug to the base and so on 3. Configuration changes the application does not clear, and the context is still valid for the new Activity 4. The return Onsaveinstancestate () involved in the destruction of an activity must call Super.onsaveinstancestate () onCreate () Onresto Reinstancestate () Creating an extensible activity class typically uses this method to restore the state. 5. If the object is stored in a package, the objects are not reclaimed by the garbage collector, and if they have been destroyed, they can cause a memory leak. 6. Do not store these objects in a packaged object: Drawable,adapter,view and other objects bound to the active context.   7. The destruction of fragments involves a method of state preservation and recovery. Onsaveinstancestate (), Oninflate (), OnCreate (), Oncreateview (), onactivitycreated () 8. Principles, The management of resources needed to be restored is independent of the process of reconstruction of activities and fragments.

Android Learning 12 configuration changes

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.