Refactor Package name in Android studio

For Example, if you want to change package from com.example.test.myapplication to com.example.animation.myapplication  .

Do below steps:

  1. Select below option from project pane.

    Capture1
    fig 1
  2. Toggle Compact Empty Middle Packages/ Hide Empty Middle Packages as below
Untitled1
fig 2

3. When Toggle compact package name to Hide Empty packages package name will broken up in individual name like below.

Capture2
fig 3

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.

Capture3
Fig 4

5. Now Rename your package

Capture4
fig 5

6. Select Refactor and do refactor from Find refactoring Preview  in bottom of Android studio.

Capture5

Now your package will rename in all places no need to worry!

Thanks !!

Advertisements

Author: rithem16

Love to learn and share knowledge!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s