How are the packages renamed in Android Studio in a simple way?

1

How do you rename java packages in Android Studio? With eclipse it was a very simple procedure, and enough with a refactor option in the menu.

But with the Android Studio with the option Refactor > Rename opens a window that indicates that there are multiple directories associated with the package, and asks if I want to rename the package or the directory .... and the results are not as expected.

What would be the easiest way to rename a package with Android Studio?

    
asked by Pablo Ezequiel 04.07.2016 в 17:04
source

2 answers

1

Pablo, the appropriate form is precisely as you indicate it, refactoring, previously Eclipse did not indicate anything to you and everything was changed of name. With Android Studio it warns you to avoid any possible problem which adds more control to the changes.

Actually changing the "package" defined in the classes implies that the name of the directory would also be changed.

Manually changing the packages I do not think is the solution for a developer, because when changing the name of the package (folder) you have to change the references in the classes.

    
answered by 04.08.2016 в 19:56
0

The easiest way is to locate yourself in the project directory using your file explorer, either Windows or Linux. You enter your project and you change the name of the folders one by one, example:

com > tupackage > tuApp

Well I think that's easier for me.

    
answered by 04.07.2016 в 17:28