android30-fragment-Understanding

Source: Internet
Author: User

Div id= ' preview-contents ' class= ' note-content ' > android30-fragment-Understanding

规范

Mobilesafe V2.0
    1. Welcome page
    2. Whether the user needs a user prompt for the first time
    3. How data from the news app is acquired
    4. Do you know the question? How to maximize the resources around you

The second is to take advantage of the SDK's own UI performance detection Tool HierarchyViewer .

Welcome Page Clear Title

Define the topic yourself Activity , or use the system'srequestWindowFeature(Window.FEATURE_NO_TITLE);

Problem stackFragmentDynamic implementation method, a good understanding of the principle of fragmentation,

It is actually an object that gets to the transaction through the Shard manager FragmentManager FragmentTransaction and Fragment commits us to the Activity corresponding position where we created the layout to be difficult.

Fragment Inter-communication getActivity() can be obtained to the associated Activity so that the corresponding control can be set up.

Life cycle

    • onAttach方法: Fragment Activity Called when the Association is established.
    • onCreateViewMethod: Fragment Called when the layout is loaded.
    • onActivityCreatedMethod: Activity Called when the method in the hold onCreate -line is finished.
    • onDestroyViewMethod: ragment Called when the layout in F is removed.
    • onDetachMethod: Fragmen called when T is associated with activity ' disassociate.
    1. Querying all animations for the use of parameters

    2. ViewPageAdapter Implementation principle

    3. The Google Open source framework uses

New acquisition

Thread() and Thread(new Runnable) the difference?
By looking at the source code, you can see that the Thread class is actually a Runnable real column of the interface, so the method inside the thread is to invoke the method in the run() interface's Runnable real column, run and the Start() JVM thread method will begin to be called run() .
Threadin the source code as follows, tatget is actually an Runable implementation

    publicvoid run() {
if (targetnull) {
target.run();
}
}

So the use of the construction method when used Thread(new Runable) is actually passed Runnable to the tatget efficiency now I don't quite understand

Experience
    1. Good frame design in advance, easy to expand after implementation
    2. Quickly put the phone defender code finish transcription can also. It's good to be familiar with the teacher and listen to the questions.

android30-fragment-Understanding

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.