Remove unused variable declarations automatically - Android Studio/Inteiij

这一生的挚爱 提交于 2020-04-06 04:28:25

问题


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


回答1:


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:




回答2:


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



来源:https://stackoverflow.com/questions/30669093/remove-unused-variable-declarations-automatically-android-studio-inteiij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!