How to override a class within an Android library project?

前端 未结 3 927
谎友^
谎友^ 2020-12-30 05:36

The following is my situation:

I have a library project and a project based on it. Now in the library I have two classes A and B, whereby A uses B. In the project

3条回答
  •  别那么骄傲
    2020-12-30 06:23

    I dont know if this is the best way to do it but i do it this way;

    I create a class A from the project and this class extends form the library project

    public class A extends libraryProject_A{
    
    //here i put all methods from the new class B to override methods from library class B
    
    }
    

提交回复
热议问题