Use android to hide classes and Methods

Source: Internet
Author: User

In the androidsource code, a certain number of Members, classes or packages (with the package.html file) are tagged with @ hide. These classes, methods, or members are not publicly available in the SDK, such as Android. app. activitythread, similar to Android. text. method. touch's getmaxscrollx () method, similar to Android. view. view members, such as mscrollx. Therefore, when these classes are used, the system prompts that the class or members cannot be resolved. The following provides a solution to this problem.

First, download the android source code for compilation. Then, find the JAR file that contains the modules of the hidden classes in the compiled out directory. The file name is usually classes. jar. For example, the JAR file of the Framework is out argetcommonobjjava_librariesframework_intermediatesclasses.jar. Finally, in the android project of Eclipse, choose project properties-> JAVA build path-> libraries-> Add library-> User library-> next-> User libraries to go to the user libraries management page, and click New to create a user library, for example, android_framework, click Add jars to add the jar package to the created user library, and click OK. To access such members, you need to change the Class search order. Select Project Properties> JAVA build path> order and export to move the created user libraries to the android SDK.

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.