我正在使用两个库(SUGAR ORM 和 Instabug)。他们都要求我在我的 list 中使用应用程序的 android:name 标签。但是,似乎您不能重复。有办法解决这个问题吗?
我的 list :
<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>
谢谢, 马特
最佳答案
看来你运气不好。你只能有一个应用程序类的实例,所以你只能在那里指定一个 android:name
。
然而,你其实并没有倒霉。 Instabug 不要求您使用他们的应用程序类,all they need is to call Instanbug.initialize(...)...
您可以在派生自 SugarApp
的应用程序类中轻松执行此操作:
class MyApplication extends SugarApp
{
@Override
void onCreate()
{
super.onCreate();
Instabug.initialize(this)
.setAnnotationActivityClass(InstabugAnnotationActivity.class)
.setShowIntroDialog(true)
.setEnableOverflowMenuItem(true);
}
}
并在android:name
中定义这个应用类。
关于android - 多应用android :name tags in manifest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28499424/