Android settings --- settings. Java

Source: Internet
Author: User

Recently, we are studying settings of Android 4.04.

From public class settings extends preferenceactivity implements buttonbarhandler, you can know the basic relationship of settings: settings is preferenceactivity.

So how do I add each item of preferenceactivity ?? The following figure shows the signal process through log printing:

Preferenceactivity ---- setlistadapter -----> headeradapter (mheaders) ----> headerviewholder (imageview icon; textview title; textview summary ;).

The basic implementation is to use the headeradapter to adapt the mheaders to the listview. When adapting to each header, the icon, title, and summary of the header will be taken out and put into headerviewholder. settag (holder); Set holer to view, and return each view as an item.

The next step is to listen to each item: onlistitemclick ----> onheaderclick. In onheaderclick, there are three functions, including startwithfragment, switchtoheader, and startactivity, to redirect the interface as needed.

Related Article

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.