0

I have the following gradle dir structure:

app
   java
       com
          me.android.mysample
                             util
                                 Car.java
                                 Purchase.java
                             MainActivity.java

I wanted to rename the package "me.android.mysample" to "you.android.yoursample", so I right clicked that package and "renamed package", but that will only rename the "mysample" subpackage instead of the whole package.

I was able to rename the first part from "me" to "you" only in finder, but that won't take care of references in the code such as

import me.android.mysample
MarcusH
  • 1,693
  • 2
  • 15
  • 20

1 Answers1

0

To Android Studio, it's a "move" operation and not a "rename" operation.

The steps:

  1. select the package you want to rename then press F6
  2. press "OK" as the default selection should be what you need
  3. press "Yes" for the warning dialog to start the refactoring process
  4. review the list of files that will be refactored, press "Do Refactor"
Kai
  • 15,284
  • 6
  • 51
  • 82