Rename package in Android Studio

后端 未结 30 1915
深忆病人
深忆病人 2020-11-21 05:21

How do you rename packages in the new IDE Android Studio, based on IntelliJ IDEA?

Is there an automatic refactoring included?

I want to make bulk refactorin

30条回答
  •  不思量自难忘°
    2020-11-21 06:10

    Quick and easy way:

    1- open MainActivity.java or any available java file.

    At the top there is the package declaration such as:

    package com.example.myapp;

    select the package portion that you want to change and press Shift+F6. I personally want to change the example.

    In the warning dialog, select Rename package and then insert the desired package name.

    2- Open AndroidManifest.xml and inside tag change the package to the desired package name.

    3- open build.gradle(Module: app) and change the applicationId to the desired package name.

提交回复
热议问题