Find out if resource is used

后端 未结 3 1900
无人及你
无人及你 2020-12-13 02:50

I am looking for an efficient way to find out if a resource (mostly a drawable) is used in Java or in an XML file.

The problem is, that on my current project the dra

3条回答
  •  半阙折子戏
    2020-12-13 02:54

    Check this: http://code.google.com/p/android-unused-resources

    UPDATE 14.12.2011: Now you can find unused resources and many more as simple as possible. Update to ADT 16 and use Android Lint. It is really amazing tool. It can find all unused resources (not only strings) and many more. From its official site:

    Here are some examples of the types of errors that it looks for:
    
    - Missing translations (and unused translations)
    - Layout performance problems (all the issues the old layoutopt tool used to find, and more)
    - Unused resources
    - Inconsistent array sizes (when arrays are defined in multiple configurations)
    - Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
    - Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
    - Usability problems (like not specifying an input type on a text field)
    - Manifest errors
    and many more.
    

提交回复
热议问题