多个应用程序android:清单中的名称标签

时间:2015-02-13 12:14:55

标签: android android-manifest

我正在使用两个库(SUGAR ORM和Instabug)。他们都要求我在我的清单中使用应用程序的android:name标签。但是,似乎你不能有重复。有没有办法解决这个问题?

我的清单:

 <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:icon="@drawable/runrouter_biggest"
        android:theme="@style/MyTheme"
        tools:replace="android:icon"
        android:name="com.orm.SugarApp"
        //I need to declare a second android:name here>

谢谢, 马特

1 个答案:

答案 0 :(得分:10)

你似乎不走运。您只能有一个应用程序类实例,因此您只能指定一个android:name

但是,你实际上并不是运气不好。 Instabug不要求您使用从SugarApp派生的应用程序类中可以轻松执行的应用程序类all they need is to call Instanbug.initialize(...)...

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

并在android:name中定义此应用程序类。

相关问题