Android Apidemos Sample Resolution (a): Content->resources->resources

Source: Internet
Author: User
Tags resource

The Android SDK corresponds to a resource ID that defines one dimension one for resources that are not defined in the Res directory. The R.java is generated in the Gen directory at compile time, and the resource ID is in the format R.[type]. [ID] Type is resource type such as Anim, array, attr, etc.

You can access these resources in code or in XML resource files such as layout, style.

The context class provides a way to access resources by accessing resources directly through, for example, GetText, getString, and, in addition, by Getresources () to replace the resources object, and then access the resource through the source object. The following diagram is the class inheritance diagram for the context:

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.