创建项目后,是否可以在android studio中更改公司域名? [英] Is it possible to change the company domain name in android studio after creating the project?

查看:146
本文介绍了创建项目后,是否可以在android studio中更改公司域名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在android studio中创建android项目时,我发现了公司域名字段.我首先创建了一个名称.现在,我想更改该公司域名.有可能改变吗?请帮我解决这个问题!

When I created android project in android studio, I found field Company Domain Name .I have created with some name first. Now I want to change that company domain name. Is it possible to change? Please help me to solve this issue !

推荐答案

您可以按照以下步骤更改域.对于您的示例,您正在尝试将域名 com.example 更改为 com.example1 .因此,您的软件包名称应类似于 com.example.application_name .

You can able to change the domain using following steps. For your example you are trying to change the domain name com.example to com.example1. So your package name should look like com.example.application_name.

  1. 在项目浏览器中右键单击包名称,然后选择 Refactor->.移动.
  2. 一个新的弹出窗口将询问您需要进行哪种重构.在其中,选择第一个将包'com.example.application_name'移至另一个包.,然后单击确定.
  3. 新的警告窗口将显示包裹在多个位置.在该警告上点击.
  4. 将打开一个新对话框.在这种情况下,将 To package 的值更改为新域名 com.example1 ,然后确保为 Search in comments and String 和<代码>搜索文本出现位置,然后单击<代码>重构.现在将打开一个新对话框,并询问创建新软件包的确认.点击.
  5. 在底部窗口中,它将搜索所有命名的 com.example ,并要求您进行重构.点击其中的执行重构.而已.您将域名从 com.example 重命名为 com.example1 .先前的软件包将不会被删除.如果您不想这样做,则可以将其删除.
  1. Right click on the package name in the project explorer and then select Refactor -> Move.
  2. A new popup will ask you to what kind of refactor you need to do. In that select the first one Move package 'com.example.application_name' to another package. and then click ok.
  3. A new warning window will show that the package is in multiple places. Click yes on that warning.
  4. A new dialog will opened. In that, change the To package value to the new domain name com.example1 and then make sure the check box is enabled for Search in comments and String and Search for text occurrences and then click Refactor. Now a new dialog will open and ask a confirmation to create the new package. Click Yes.
  5. In the bottom window it ll search all the named com.example and ask you to refactor. Click Do Refactor in that. That's it. you renamed the domain name from com.example to com.example1. The previous package will not be deleted. if you don't want that means you can delete it.

这篇关于创建项目后,是否可以在android studio中更改公司域名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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