Nirav Jain
Nirav Jain

Reputation: 47

Multiple Application android:name in Android Manifest

I have merged two different projects file in Android Studio My problem is both the project files needs to declare application android:name

Android Manifest

<application
    android:name=".app.AppController"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.WebViewApp.Red"
     >

I need to add another one right below

<application
    android:name=".WebViewAppApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.WebViewApp.Red"
     >

I know its not possible. is there any way around

Mainactivity

public class MainActivity extends ActionBarActivity

WebViewAppApplication

public class WebViewAppApplication extends Application

AppController

public class AppController extends Application

Upvotes: 1

Views: 2585

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006724

Have WebViewAppApplication extend AppController.

Or, have AppController extend WebViewAppApplication.

Or, merge the two classes together into a single class.

Or, remove the functionality from one Application subclass, replacing it with something else (e.g., standard Java singletons).

Upvotes: 2

Related Questions