Android Learning-Seventh Day

Source: Internet
Author: User

What to learn: Viewpager and Dialogs components

====viewpager components = = = =

Its role is mainly to support the screen left and right sliding switch list elements, using the following:

1. First define the ID number information, create the Res/values/ids.xml, add the following content:

<?xml version= "1.0" encoding= "Utf-8"?>

<resources xmlns:android= "Http://schemas.android.com/apk/res/android" >

<item type= "id" name= "viewpager"/>

</resources>

This ID number is used for the SetId method of the Viewpager class, such as Mviewpager.setid (R.id.viewpager)

2.ViewPager class, you also need to use the Pageradapter class to get the data of the model layer, usually using the

Framentstatepageradaper class, the default needs to implement two methods GetCount, GetItem, it should be noted that Viewpager is always displayed after the default open

Get the first element from the Pageradapter Class!

3. Another Pageradapter class is Fragmentpageradapter, which differs from framentstatepageradaper in that

Framentstatepageradaper will destroy the list element objects that are not needed, save memory!

====dialogs components = = = =

Its role is to get input, or prompt the user some information, generally inherit the Dialogfragment class, will use the fragment class, it is not unfamiliar!

Need to understand the interaction between the fragment components again, I have two mobile phones and tablets, and later to fill up!

Android Learning-Seventh Day

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.