Rename package name in android

2019-07-04 09:19发布

问题:

I want to rename package name in my project. I have 9 packages so far and when I have change package name ,the changes are done in java and xml file.

But in Manifest.xml file, the activity definition section , package activity doesn't change after rename package.

Please help me.

回答1:

There is an option for this in Android Tools, here are the steps for doing this

  1. Right Click on the project
  2. Click on Android Tools
  3. Click on Rename Application Project
  4. Enter the new package name


回答2:

First change the package name in the manifest file
Re-factor > Rename the name of the package in src folder and put a tick for rename subpackages, thats it.



回答3:

Could you use Search and replace?

In Eclipse:

Open the AndroidManifest.xml

Edit-->Find/Replace

Find: old.app.name
Replace With: new.app.name

Click OK.

Just check everything is OK before you save the file.

/Steffen