In Android Studio, you can do this:

For example, if you want to change com.example.app to my.awesome.game, then:
1. In your Project pane, click on the little gear icon
2. Uncheck / De-select the Compact Empty Middle Packages option



  1. Your package directory will now be broken up in individual directories

  2. Individually select each directory you want to rename, and:

    • Right-click it
    • Select Refactor
    • Click on Rename
    • In the Pop-up dialog, click on Rename Package instead of Rename Directory
    • Enter the new name and hit Refactor
    • Allow a minute to let Android Studio update all changes
    • Note: When renaming com in Android Studio, it might give a warning. In such case, select Rename All



  3. Now open your Gradle Build File (build.gradle - Usually app or mobile). Update the applicationId to your new Package Name and Sync Gradle, if it hasn't already been updated automatically:



  1. Done! Anyways, Android Studio needs to make this process a little simpler.

http://stackoverflow.com/questions/16804093/android-studio-rename-package

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android App 开发经验总结
  2. Android 中Service生命周期
  3. android 学习 之 布局(下)LinearLayout,Rela
  4. 新安装Android(安卓)Studio遇到问题集合+
  5. android studio2.0解决办法 Plugin is to
  6. android 之JSON
  7. 在android上监听网络状态的变更
  8. Android 判断网络是否可用以及网络类型(WI
  9. android (22)
  10. Android:Galaxy Nexus升级到4.1.2,并root(设