Android studio remove middle part from package name

前端 未结 6 645
陌清茗
陌清茗 2021-02-05 12:08

I want to remove the middle part from the package name. Ex: com.example.app to com.app

I have tried few things but not able to remove t

6条回答
  •  死守一世寂寞
    2021-02-05 12:39

    There is a much better way to do this. com.example.app >> com.app

    In Android Studio,

    1) Open your project pane (tab on left top) select Android option.

    2) In the same pane click on the gear icon and uncheck "Compact Entity Middle Packages".

    3) Expand your package hierarchy in Project pane.

    4) Now drag the package app (the one you want to move) on the package com (where you want to move).

    5) You will see a red boundary around the com package now drop package app.

    6) A popup should appear select "Move package", next enter com package path, next select do refactor.

    Done!!

    Please note, different Studio versions have different options but drag and drop method remains the same

提交回复
热议问题