重命名包 Android Studio [英] Rename Package Android Studio

查看:32
本文介绍了重命名包 Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这里有很多关于此的信息.但我找不到我的特定问题的答案.

我正在尝试重命名当前如下所示的包:

com.example.app.name

我想把它重命名为

com.example.name

我知道你必须重构重命名并确保你关闭了压缩空中间包",但我只知道当它们是三个目录时如何重命名它们,即 com.example.name 而不是如何真正摆脱目录之一.那么如何将其从 4 减少到仅 3?

希望我正确解释了这一点.

解决方案

Rename Package Android Studio com.example.app.namecom.example.name

步骤:

  1. 关闭/取消选择紧凑型空中间包.
  2. 将所有源从名称"移动到应用".
  3. 删除姓名".
  4. 将应用程序"更改为名称".:D

I know there is a lot of info on this here. But I can't find the answer to my particular question.

I'm trying to rename a package that is currently like this:

com.example.app.name

and I want to rename it to

com.example.name

I know you have to do refactor rename and make sure you have 'compact empty middle packages' turned off but I'm only know how to rename them when they are three directories long i.e. com.example.name and not how to actually get rid of one of the directories. So how do I reduce it from being 4 to only 3?

Hope I explained this correctly.

解决方案

Rename Package Android Studio com.example.app.name to com.example.name

Steps:

  1. Close/Unselect Compact Empty Middle Packag.
  2. Move all source from "name" to "app".
  3. Delete "name".
  4. Change "app" to "name". :D

这篇关于重命名包 Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆