简体   繁体   English

如何在AndroidManifest.xml中将多个自定义应用程序指定为我的应用程序?

[英]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.

相关问题 如何指定 AndroidManifest.xml 的位置? - How can I specify location of AndroidManifest.xml? 如何解决我的 flutter 应用程序的 androidmanifest.xml 中的此 firebase 消息传递错误? - How do I resolve this firebase messaging error in the androidmanifest.xml of my flutter application? 多 <application> 在AndroidManifest.xml中 - Multiple <application> in AndroidManifest.xml android运行我的应用程序给出错误,我在AndroidManifest.xml中缺少android:configChanges的AdActivity - android run my application give error i missing AdActivity with android:configChanges in AndroidManifest.xml 如何在AndroidManifest.xml中指定包装器类 - How to specify a wrapper class in AndroidManifest.xml 如何在AndroidManifest.xml中调试应用程序类问题? - How to debug application class issues in AndroidManifest.xml? 如何避免在Cordova Android应用程序中覆盖AndroidManifest.xml? - How to avoid overwriting AndroidManifest.xml in Cordova Android application? 带有多个应用程序标签的AndroidManifest.xml - AndroidManifest.xml with multiple application tags 如何从Java下拉AndroidManifest.xml中列出的应用程序版本? - How Do I Pull The Application Version Listed in AndroidManifest.xml From Java? 我可以从手机访问androidmanifest.xml文件吗? - Can I access androidmanifest.xml file from my phone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM