Multiple application android:name tags in manifest

后端 未结 1 627
故里飘歌
故里飘歌 2021-01-13 16:46

I am using two libraries(SUGAR ORM and Instabug). They both require me to use the android:name tag of the application in my manifest. However, it seems you cannot have dupli

相关标签:
1条回答
  • 2021-01-13 17:13

    You seem to be out of luck. You can have only one instance of application class so you can specify only one android:name there.

    However, you are actually not out of luck. Instabug does not require you to use their application class, all they need is to call Instanbug.initialize(...)... which you can easily do in your application class derived from SugarApp:

    class MyApplication extends SugarApp
    {
        @Override
        void onCreate()
        {
            super.onCreate();
            Instabug.initialize(this)
                .setAnnotationActivityClass(InstabugAnnotationActivity.class)
                .setShowIntroDialog(true)
                .setEnableOverflowMenuItem(true);
        }
    }
    

    And define this application class in android:name.

    0 讨论(0)
提交回复
热议问题