Android four components of activity & Fragement (cont.)

Source: Internet
Author: User

The similarities and differences between 1.Activity and fragment.

Activity is the body of UI interaction, and fragment is the element on the subject.

An activity can consist of 0 to n fragment.

Fragment can be understood as a control of activity, but fragment is more tightly connected than the general control.

Fragment can not be separated from activtiy existence, and only activity can accept intent carrier, fragment not.

2.<fragment> label How do I specify which fragment to use?

<fragment class= "xxx" >

3. Should the data adapter be used on listfragment or on a listfragment listview?

Listfragment binds the data of the ListView, the data must be bound through the Listfragment.setlistadapter () interface,

Instead of using listview.setadapter () or other methods!

But it is bound to the data of the ListView .

4. What are the ways to find the fragment that the application is in?

Fragmentmaneger.findfragmentbyid

Fragmentmaneger. Findfragmentbytag

5. What are the interpolator and what are the functions?

Animation, first of all, when we define the animation, it is usually the beginning and the end. The intermediate process is solved by the interpolator.

6. Can I use animations on one more custom class?

Yes, use Objectanimation

Android four components of activity & Fragement (cont.)

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.