Android--adapter

Source: Internet
Author: User

Android--adapter

  1. Basic concepts

    Adapter (adapter), which transforms the interface of a class into an interface that the client expects, so that two classes that would otherwise not work together because of an interface mismatch can work together. Obviously , the existence of Adapter is to cooperate with the two different parts, so that they can coordinate their work. In Android ,Adapter is the link between the foreground UI and the underlying data, and the relationship between them can be expressed as.

  2. Common Adapter

    Adapter itself is just an interface, it derives ListAdapter and the Spinneradapter two sub-interfaces, where ListAdapter to be Abslistview provides list items, while Spinneradapter to be Absspinner provides list items. The inheritance relationship of the Adapter interface and its implementation class is as shown.

     

          These are more commonly used adapter

  

  

  1. Arrayadapter<t>

    any type (T) Array Adapter

    baseadapt Er

    < Span style= "font-family: the song Body;" It implements the common base class adapter so it applies To listview ( interface Span style= "Font-family:times New Roman;" >) and spinner ( Span style= "font-family: the song Body;" > by implementing the specified spinneradapter interface

    cursorada Pter

    < Span style= "font-family: the song Body;" > cursor The data exposed to control

    headerviewlistadapter

    listview Header Span style= "font-family: the song Body;" > control

    ListAdapter

    extends the Adapter , is Listviewts_ a bridge between list data

    Resourcecursoradapter

    created in XML defined in the file. views

    simpleada Pter

    < Span style= "font-family: the song Body;" The static data is mapped to xml file defined It's very powerful.

    simplecursoradapter

    cursor columns in the map to xml of the file definition textview imageview

    Spinneradapter

    extends the Adapter , is Spinnerts_ the bridge between data

    Wrapperlistadapter

    include a different list Adapter the list Adapter

Android--adapter

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.