简体   繁体   English

在 android studio 中更改包名称和域

[英]Change package name and domain in android studio

I want to change the package name in android studio but I don't know how to change it.我想在android studio中更改包名称,但我不知道如何更改。 I have package like this com.mycompany.myproject and I want to change it to com.abc.xyz.我有一个像 com.mycompany.myproject 这样的包,我想把它改成 com.abc.xyz。 Thank you so much for your answer!非常感谢您的回答!

Click on project setting icon and uncheck Compact Empty Middle Packages, and right click on each package Refactor->Rename单击项目设置图标并取消选中 Compact Empty Middle Packages,然后右键单击每个包 Refactor->Rename

here are the screen short.这是屏幕短。

在此处输入图片说明

I have my own way of doing that.我有我自己的方法。 I simply created a new package, and then copied all the classes in the old one to it.我只是创建了一个新包,然后将旧包中的所有类复制到其中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM