문제

I really apologize, if this question has been answered earlier, I haven't found any appropriate answer so I am asking this one.

I have developed an android application. Now I want to develop same application with different splash screen and logo. So I want to use my earlier project for development so that if some changes happen in logic I can track them easily.

What i am trying to do is that add this project and use the project as library every where.

(Project 1 -> Parent project which I want to use as library)

(Project 2 -> Child project where I want to use the parent project) I went to Project 2 (where I want to add/use parent project as library)
project properties -> Java Build Path -> Project -> Add then added the Project1 (parent project)

Now in MainActivity of the Project2 (child project) where I am using the Project1

MainActivity:

package child.project.appStar;
 public class MainActivity extends parent.project.appStar.MainActivity {

 }

Now is there anything else that I need to add or can I simply run this project in my devices?

Any kind of help would be really appreciated.

도움이 되었습니까?

해결책

You can make the main project as library project. IF you using eclipse open the main project project.properties file and add this :

 android.library=true
 manifestmerger.enabled=true

And don't add any main/launcher intent in any activity of manifest.xml file.

Child/Sub project add these lines on the project.properties file. "../MainProject" is the path of ur main project and "MainProject" is the project name. {make sure these are correct.}

 android.library.reference.1=../MainProject
 manifestmerger.enabled=true
 android.library=false

Then at sub project you just need to import the main project files .. and u can access them.

 import com.MainProject.myActivity;

 public class MainActivity extends myActivity{ }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top