Access to methods in an abstract class in a Android Studio library

By : Pich
Source: Stackoverflow.com
Question!

I created an library in Android Studio (aar) and have successfully imported it into another application I have created. In the library, I have a base abstract class which I extend from in order to make the class that I want to use in my new application. In my application, I am successful in calling methods in the library's child class but it doesn't seem to have access to the methods in the base abstract class.

Library

AbstractClass {
    public void methodAbstractClass();
}

ChildClass extends AbstractClass {
    public void methodChildMethod();
}

MainApplication

  import ChildClass;

  MainApplication {
     public void doWork() {
       methodChildMethod(); // Works
       methodAbstractClass(); // Does not work, not visible
     }
  }

Am I missing something? Do I need to add overriding calls in my ChildClass class in the library so that the application can access methods in the AbstractClass class?

Thanks!

By : Pich


Answers

Might be that you're only importing the ChildClass.

By : imorsi


This video can help you solving your question :)
By: admin