Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Copy Module

I am trying to make a copy of a module in Android Studio, to make small changes. How can I do that? I found several solution but i did not get any to work. Instead of posting my questions in several old topics i decided to open a new question.

I created a copy of the module-directory, changed the name of the folder and edited the package-name in the manifest. Now i am stucked: How do i automatically change the package in all files and make it a working android-project again? I tried to select the package and refactor it but that would only change the package in manifest or in the project tree but not in the java-files.

Thank you!

like image 721
honiahaka10 Avatar asked Aug 19 '15 15:08

honiahaka10


2 Answers

I just copied/pasted it from within Android Studio, and that worked for me:

  1. In Android Studio, make sure you have the Project view selected for your Project pane.
  2. Select module and copy.
  3. Select the folder name of your project in the Project pane (this should be the name of your project and the parent directory for the module).
  4. Paste it in (it will ask you to rename it).
  5. Add the new module to your settings.gradle file.

    include 'old-module', "new-module"

  6. Rebuild/sync your project (you should see another module option now)

  7. Run on your device/emulator.
like image 188
codingjeremy Avatar answered Sep 23 '22 05:09

codingjeremy


File -> New -> Import Module -> paste module's path DONE

like image 30
Kyriakos Georgiopoulos Avatar answered Sep 22 '22 05:09

Kyriakos Georgiopoulos