Rename package in Android Studio

后端 未结 30 2023
深忆病人
深忆病人 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条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 05:45

    This I believe what you are looking for is Refactor > Move. You can also press F6.

    You will get two popups. Make sure you select rename package on both. After that you will get a pop up to place the new package name.

    Please note that if your package name is, for example, com.example.android.projectname then this will let you change com.example.android to something else.

    One more thing, this will update the applicationId in your build.gradle as well. Just make sure that the checkboxes for "search in comments and strings" and "search for text occurrences" are both checked for it to work.

提交回复
热议问题