Android Studio modifies the project's package name

Source: Internet
Author: User

The modified package name of Android Studio is not as good as it is in the eclipse environment. You may also be familiar with the operation of Eclipse and are not familiar with the operation of Andoid studio. In the development of a project, you may encounter a package name that needs to change the module or the package name of the project. Some of the changes to the package name in Android Studio environment are documented below.

The default display of the usual items is as shown in the structure. The default setting for Android Studio is to hide the empty package name. For example, under the Com.viewgroup package in the project, no files are hidden and the contents of the demo package are displayed directly.

Before modifying the package name, we need to set the contents of the empty package name to be displayed. For example, right-click the settings icon and uncheck Comact Empty Middle Packages in the popup menu bar.

After the operation, the structure of the project becomes as follows:

Then, for a better understanding, I showed the structure of the project as a tree-shaped project structure. (This setting is based on personal preference, some people do not like tree structure)

For example, set the display structure to a tree:

Right-click the settings icon and uncheck Flatten Packages in the popup menu bar

is the tree structure display

First case: Change ViewGroup to View.group (group under View package)

You may rename the package name under the ViewGroup package.

Then, in the pop-up box, add a dot to the middle of the Vewgorup. But the practice tells us that this is not possible. As is not supported.

The following actions can meet our requirements:

Second case: Remove the group package

Then, we can move the demo package directly under the view package according to the above principle, and then delete the group package.

(You can select the demo package long press the left mouse click, drag it to view, this will pop up the moving bullet box, OK)

In the third case, add the package directory

The same principle, do not write ...

Android Studio modifies the project's package name

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.