Rename package in Android Studio

后端 未结 30 1911
深忆病人
深忆病人 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:02

    Please try the following steps:

    1. Click on setting gear icon and deselect Compact Empty Middle Package
    2. Now we can see each package folder is broken into parts
    3. Now right click on the first package folder >>> refactor >>> rename
    4. Now a warning will be displayed but you go ahead and click Rename Package
    5. After that enter your domain name for the package name
    6. Click on ‘Do Refactor’
    7. Now it has change the package domain name of the App. Now Change the domain extension and App folder name according to your requirement
    8. Now open build.gradle (Module: app) in Gradle Scripts. Here change the application id and click Sync Now.

    *******Finally it’s done ******

提交回复
热议问题