简体   繁体   中英

How do I rename the Project itself after refactoring in Android Studio?

I can't seem to change the name of the actual project after duplicating it in the file system and refactoring/renaming. Here are the steps I've taken

  1. In OS X finder, right-clicked the project folder "Finish Activity" and selected "duplicate"
  2. Renamed the duplicate folder to "Activity Lifecycle"
  3. In Android Studio, refactored/renamed the package and confirmed that it was renamed in all the correct places.
  4. Changed the name of the app in the Strings.xml resource to "Activity Lifecycle."
  5. Closed AS and reopened.
  6. When prompted with AS's Welcome screen, at first I couldn't find the project "Activity Lifecycle" under the list of "Recent Projects." This is because it is still being listed as "Finished Activity."

Step 6 above indicates the issue I am trying to resolve. The app functions as expected with no visual problems. In addition to the issue mentioned above, on the top left of the project explorer it lists the project name as "Finish Activity" with the blue icon indicating it is the project name. All over references say some version of "Activity Lifecycle."

This answer Completely renaming a project in Eclipse

says to edit the .project file, in the project folder, but no such file exists. I do have hidden files being shown btw.

Got it. After duplicating the project folder in the file system, make sure you are opening it in AS using the "Import Project" selection and not the "Open Project" selection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM