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
I tried the two top-voted solutions but found some issues even though both work to some extent.
After some experiments I found the following method works well for me.
If you just need to change the last part of package name, use the method outlined by GreyBeardedGeek, namely
Right-click on the package in the Project pane. Choose Refactor -> Rename from the context menu
If you need to change the whole package name, do the following.
Right-click on the package in the Project pane. Choose Refactor -> Move from the context menu
This will create a new package folder (when necessary) but will keep the last part of your package name as before. If you need to change the last part, do the rename accordingly.
Note also that you may need to modify package names in e.g. build.gradle, manifest, and/or any xml resource files, or even in your code if hardcoded. After all that, do Sync/Clean/Rebuild project as necessary.