简体   繁体   中英

Moving android resources & activities from main project to library project

I have an android project which relies on a 'common' android library project.

Now that I want to create a differing build of the main project, I thought I would move all activities, resources etc that would apply to both to the library project, then only keep the differences in the main projects.

However, when I copy resources & activities over, the library project refuses to build the R class, which causes problems. I know that assets require a duplicate copy, but thought res & activities would work fine.

Is there some weird trick, to moving resources and activity code to the library project?

I am using eclipse.

I think you want to have the 2 same project in the workspace.

If it is, you can follow this:

1) Create a zip of your current project from the workspace.

2) Import this zip file in your current work space, where your first project is already there.

Note: If you import that zip file it give you an error project already exists in the workspace.

Now what all you have to do is just rename your first project. After that you can import that zip file -> now both projects will exist in your workspace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM