Arpit Jaiswal
Arpit Jaiswal

Reputation: 19

How to remove unused xml , java code from android studio

I am trying to optimizing my android project by removing unused xml and java code from android studio and i am searching for such shortcuts which can be helpful for me to achieve the optimization.

Thanks in Advance.

Upvotes: 0

Views: 2168

Answers (2)

Aram Tchekrekjian
Aram Tchekrekjian

Reputation: 935

Android studio provides you with set of refactoring and code optimization tools, where you can remove unused resources and variables, optimize imports.

Just right click on your project's root folder > Refactor > Remove Unused Resources...

And also same way Right click > Optimize imports

Also you can try code analysis feature of Lint ... Right click on project's root folder > Analyze > Inspect code this finds code smells and gives you warning for different aspects in your code.

Check the following link to read more about Lint

Upvotes: 5

Dus
Dus

Reputation: 4230

In Android Studio :

  1. Go to Analyze -> Inspect code
  2. Unused xmls will be in Android > Lint > Performance enter image description here

Upvotes: 3

Related Questions