For Example, if you want to change package from com.example.test.myapplication to com.example.animation.myapplication .
Do below steps:
- Select below option from project pane.
- Toggle Compact Empty Middle Packages/ Hide Empty Middle Packages as below
3. When Toggle compact package name to Hide Empty packages package name will broken up in individual name like below.
4. Now Click on individual directories and select Refactor using right click on directory name which you want to change or use Shift + F6 then select rename package.
5. Now Rename your package
6. Select Refactor and do refactor from Find refactoring Preview in bottom of Android studio.
Now your package will rename in all places no need to worry!