Remove unused variable declarations automatically - Android Studio/Inteiij

后端 未结 2 1510
悲哀的现实
悲哀的现实 2021-01-17 11:53

Is there a way to remove all unused field declarations automatically in Android Studio/Intellij ?

相关标签:
2条回答
  • 2021-01-17 12:00

    As simple as that, just press ctrl+alt+shift+I and type unused declaration. You can also use this in removing other unused resouces, for example press ctrl+alt+shift+I and type unused resources. When the search is finished, select Unused declaration from the result tab, right click and select Safe delete

    0 讨论(0)
  • 2021-01-17 12:01

    Select Analyze > Run Inspection by Name..., type unused declaration and confirm with Enter. When the search is finished, select Unused declaration from the result tab, right click and select Safe delete:

    enter image description here

    0 讨论(0)
提交回复
热议问题