How do I rename the android package name?

sandalone picture sandalone · Jul 6, 2011 · Viewed 200.1k times · Source

Pressing Shift+F6 seems only to rename the last directory.
For example, in the project com.example.test it will offer to rename test only. The same applies if I navigate to package name in .java or Manifest file and press Shift+F6.

So is there a way to rename the package?

Answer

Cristian picture Cristian · Jul 6, 2011

You can do this:

  1. Change the package name manually in the manifest file.
  2. Click on your R.java class and the press F6 (Refactor->Move...). It will allow you to move the class to another package, and all references to that class will be updated.