We're working on a project (Project A) in college that has to extend from a class that is another project (Project B), made years ago. This is working under Eclipse, and developing apps for android, so this is in fact Activities we're talking about.
So far I've tried this:
- Adding project B on Project A's build path (In the Projects TAB)
- Importing, with full package name and .java name.
The thing is that every solution I've found is for working with .jar, .class or even .apk files, but I'M NOT working with that, project B is a simple project full of .java files.
To be a little more clear about it, Project A has a class named ClassFromProjectA, and Project B has a class like ClassFromProjectB
. ClassFromProjectA
is like follows:
public class ClassFromProjectA extends ClassFromProjectB{}
ClassFromProjectB is like follows:
public class ClassFromProjectB extends ListActivity implements OnInitListener, OnGesturePerformedListener {}
The "only" thing ClassFromProjectB is doing is, uppon extending from it, it changes the default layout for a ListView, applies specific navigation options, applies gestures to every activity extending from it, and a couple more tweaks.
If I make this:
public class ClassFromProjectA extends ListActivity{}
Everything works fine with my class, no errors, no warnings, no nothing.
We are ABSOLUTELY sure that ClassFromProjectB
is working, it was a previous succesfull college project, and it also has an Example activity within its files to check functionality, and everything works like a charm. That's the thing though, it only works because it is in the same project file. But we CAN'T do that, we have to import and extend, and it isn't workin'.
Please, let me know if you know how to make this work, or point me in the right direction.
Try reference projectB in projectA as follows:
After this you can import class from projectB.
What you can do if you have the complete project B that you need to include inside your project (project A).
Now you should be able to import packages from Project B to project A and use its classes with no problem.