7

So, I want to rename a file in android studio (layout/resource files, etc...), but I want to do it safely. Basically, I want to rename without refactoring. I will take care of errors that come afterwards, but I don't want Android Studio to wreck havoc on some files that might not even have relations with the current file.

Basically, I want control on the renaming. A simple file rename. Is there a way to do it without having to go to Windows Explorer?

1 Answer 1

6

There's two options and both inside the Refactor menu. The Refactor> Rename option is exactly what you don't want the other one Refactor> Rename File option is just what you want. Also when using Refactor> Rename it will show you the Refactoring Preview. There you see and select what is going to be affected by this change. To see options just right click

Sign up to request clarification or add additional context in comments.

3 Comments

correct, but there is no way to rename resources this way, this will change code occurances as well. For resources renaming seems like it's needed to open Windows Explorer
No i updated my answer please check and remember you can always use right click exclude option to choose what is going to be affected from the refactoring.
I see no "rename file" option Android Studio 2.3.2. I only see rename. Oh wait, it's available on java files, but not on resource files. interesting...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.