how to handle multiple application classes in android

后端 未结 2 1327
名媛妹妹
名媛妹妹 2020-11-28 10:30

I am developing a native android application, in which I am trying to use 2 open-source libraries. Problem is both the libraries are using Applicati

2条回答
  •  一生所求
    2020-11-28 11:19

    You need to implement Multilevel inheritance to resolve this scenario.

    This is your scenario

    public Lib1Application extends Application{
    
    }
    
    public Lib2Application extends Application{
    
    }
    
    public YourApplication extends Application{
    
    }
    

    How to resolve this?

    public Lib1Application extends Application{
    
        }
    
        public Lib2Application extends Lib1Application{
    
        }
    
        public YourApplication extends Lib2Application{
    
        }
    

    finally in mainfest.xml

    
    

提交回复
热议问题