Rename package in Android Studio

后端 未结 30 1893
深忆病人
深忆病人 2020-11-21 05:21

How do you rename packages in the new IDE Android Studio, based on IntelliJ IDEA?

Is there an automatic refactoring included?

I want to make bulk refactorin

30条回答
  •  北海茫月
    2020-11-21 06:10

    I have seen the top voted answers but i found is a little bit different to do this, i try to do the most complete tutorial.

    From the Android Studio click over the gear icon ( Gears icon ) and then select the option: "Compact Empty Middle Packages", to see the folders separated in a tree view.

    Now select the folder, click right button to open the contextual menu, select Refactor and then Rename

    You will be advised to refactor the package:

    Then a window will show the coincidences inside the proyect, select "Do Refactor":

    We don´t have to change manually the AndroidManifest.xml or build.gradle files, Refactoring the package will do the job!.

提交回复
热议问题