1

Possible Duplicate:
Package renaming in eclipse android project

Is there a easy way to change the package name of an android project? When I change it in manifest from xxx.en to xxx.zh, I need to fix all "import xxx.en.R" to "import xxx.zh.R" in every java files! plz help me, a easy way is needed.

Community
  • 1
  • 1
thecr0w
  • 2,148
  • 4
  • 33
  • 59
  • if your using eclipse, right click on the package, then click refactor, then Rename. It will update all its references. for shortcut click on the package then press Alt+Shift+R – RoRo Jan 04 '13 at 10:54

4 Answers4

5

If you are using eclipse, 3 steps:

1) change in manifest

2) select project in navigator and press clt+h. Search from string import xxx.en.R; In search tab you will get full list of string matches.

3) Right click any of the match and select replace all , enter the replace text as "import xxx.zh.R;"

Hit enter and its done.

Nimish Choudhary
  • 2,048
  • 18
  • 17
5

You can try by: right click on your project > Android Tools > Rename Application Package. I think this link is useful for you: How to change package name of an Android Application

Community
  • 1
  • 1
secretlm
  • 2,361
  • 2
  • 27
  • 38
1
  1. In the manifest file, instead of the old package name, put the new package name at every location Your classes may need direct package name references like activity android:name="com.abc.Myactivity".
  2. Right click the package name inside the project. Select Refactor>Rename and type the desired new package name. select "update references".
  3. Change the layout xml files with the new package name
ambit
  • 1,099
  • 2
  • 28
  • 43
1

It is very easy Just click on package which you want to change name than press F2 key it will show warning than press ok than rename package.

com.*.**

after press F2

Com.####.*

Yogesh Tatwal
  • 2,722
  • 20
  • 43