My Android application requires two application classes,one is volley AppController and another one is Analytics class.I am confused how to add both at a time.please help me and get me out of this.
Asked
Active
Viewed 4,124 times
4
-
1you can not add `android:name` twice. you will get `Duplicate attribute name` error. – Rustam Sep 04 '15 at 10:15
-
Thanks for reply @Rustam....Is there any solution for my problem? – Hari krishna Sep 04 '15 at 10:18
-
check my answer link how to handle multiple application classes in android – Rustam Sep 04 '15 at 10:20
3 Answers
9
You need to implement Multilevel inheritance to resolve this scenario.
This is your scenario
public Lib1Application extends Application{
}
public Lib2Application extends Application{
}
public YourApplication extends Application{
}
How to resolve this?
public Lib1Application extends Application{
}
public Lib2Application extends Lib1Application{
}
public YourApplication extends Lib2Application{
}
finally in mainfest.xml
<application
android:name="com.your.packagename.YourApplication"
android:icon="@drawable/ijoomer_luncher_icon"
android:label="@string/app_name"
>

Peyman Mohamadpour
- 17,954
- 24
- 89
- 100

Android Tutorial
- 829
- 1
- 8
- 20
2
Make your volley AppController class extend your Analytics application class. Then specify your volley AppController in your manifest.

Dean Wild
- 5,886
- 3
- 38
- 45
-
Good stuff, please mark my answer as correct if it solved your problem! – Dean Wild Sep 04 '15 at 10:37
0
You need to implement Multilevel inheritance to resolve this scenario.