2

i'm working with Volley lib and Sugar ORM. Each one oblige me to set it as my application in 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 .

4

1 回答 1

3

由于com.orm.SugarApp是从类扩展,您可以简单地从Application继承您的 Volley ,如下所示:AppControllerSugarApp

public class AppController extends com.orm.SugarApp {
    //your controller logic
}
于 2015-04-22T11:17:29.150 回答