Ken
Ken

Reputation: 295

Copy Android Activity from one app to another

The search results for my question were about transferring data between apps in the runtime; this is not my question.

What I want to know is how to copy one activity from one app to another in the development mode.

I have an old app that has activities that I do not want to redevelop in the new app.

So I wanted to just copy these activities into the new app.

I am using Android Studio.

Upvotes: 2

Views: 5132

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007276

Step #1: Open the old project in Android Studio.

Step #2: Open the new project in Android Studio, choosing to open it in a new window (rather than the window you have from Step #1).

Step #3: Drag and drop the Java class files from the old project into the new project.

Step #4: Drag and drop the resources used by those Java classes from the old project into the new project.

Step #5: Find the <activity> elements from the manifest of the old project and copy those into the same basic location in the manifest of the new project.

Upvotes: 2

Related Questions