How does Android Studio use lint to clear useless resource files?


When using AndroidStudio for App development, we often reference a variety of resource files in the project, including images, layout files, and constant reference definitions. With the iteration of the project version development, the resources of each phase will change, and some useless resources will definitely be left. At this time, if we manually search one by one, the efficiency will be very low. At this time, we have to learn AndroidStudio to use lint to clear useless resource files.

1. Open AndroidStudio in the project, click on the top menu barAnalyze -> Run Inspection by NameAs shown below:

2. ClickRun Inspection by NameA dialog will pop up. Enter in the dialogunused resourceAs shown below:

3. Then click on the drop-down listunused resource. A dialog box will pop up as shown below

4. In the dialog box, we can chooselint scans the entire project, you can also scan a specified directory. afterStudio will automatically analyze, you can then clean up useless resource files based on the results. The scan results will appear below

related suggestion:

How to remove the app title in Android Studio?

How does Android studio add module dependencies to the project?

How to add comments at the beginning of the file created by AndroidStudio?