Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBoris Vukobrat
4,248 PointsRefactoring package name
Is there a way to refactor package name in Android Studio? I have a package name "one.two.three", and want to change it to "two.three.four"
1 Answer
Gloria Dwomoh
13,116 PointsTry this.
Boris Vukobrat
4,248 PointsBoris Vukobrat
4,248 PointsHm, yeah, I've done it by importing stuff in a new project. Your example is somewhat better but also 'painful' : ). Copying package and then manually renaming references. Refactoring upon a package works fine, but I wanted to name folders on disk differently. Instead, I think better practice is to go one level deeper and have "one.two.three.four"
Gloria Dwomoh
13,116 PointsGloria Dwomoh
13,116 PointsOh okay. yes it is easier to add... "four" in the end...than change the whole package name. At least now you know how to do it if you ever decide to. It is good to do what works for you :D