[英]How can i specify more than 1 custom application as my application in AndroidManifest.xml?
i'm working with Volley lib and Sugar ORM. 我正在与Volley lib和Sugar ORM合作。 Each one oblige me to set it as my application in AndroidManifest.XML
每个人都必须将其设置为AndroidManifest.XML中的应用程序
<application
android:name="pixels.myapp.app.AppController" // application 1
android:name="com.orm.SugarApp" // application 2
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="DATABASE"
android:value="myapp.db" />
<meta-data
android:name="VERSION"
android:value="2" />
<meta-data
android:name="QUERY_LOG"
android:value="true" />
<meta-data
android:name="DOMAIN_PACKAGE_NAME"
android:value="pixels.myapp" />
I know that is not possible to declare 2 application in the same Manifest but is there anyway to do that . 我知道不可能在同一清单中声明2个应用程序,但是仍然可以这样做。
Since com.orm.SugarApp
is extending from Application
class, you can simply inherit your Volley's AppController
from SugarApp
, like this: 由于
com.orm.SugarApp
是从Application
类扩展的,因此您可以简单地从SugarApp
继承Volley的AppController
,如下所示:
public class AppController extends com.orm.SugarApp {
//your controller logic
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.