4

I have a Appp class that extend from Application and call Appp in manifest.

There is two another jar, that each author said call them in manifest as Application tag.

According to how to handle multiple application classes in android question, to have multiple application classes that extend from Application, we should extend some application class from another application class, and call upper class in manifest.

But in my case, i don't have sources, and just have jars. what can i do?!

Community
  • 1
  • 1
Dr.jacky
  • 3,341
  • 6
  • 53
  • 91
  • 1
    This smells like an [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Multiple application classes is not likely the solution you really want. Please specify the problem where you think multiple app classes could be a solution to. – laalto Jun 27 '14 at 13:31
  • @laalto Question edited. – Dr.jacky Jun 27 '14 at 13:54
  • Would it be possible to have your own instance of Application extend the Application in your JAR file, and link to your own in your manifest? – Cruceo Jun 27 '14 at 14:24
  • @Guardanis No. jar compiled and i don't have any source. – Dr.jacky Jun 27 '14 at 19:12
  • I get the same problem when I use Soomla for in-app-purchase and Parse for Push Notification. Do you have any solutions @Mr.Hyde? – Nikel Arteta May 19 '15 at 07:22
  • 1
    @NikelArteta The solution is you should extends one of your app classes from upper classes (that extended itself from application class or from some app class that extended itself from application class (these are in chain). I think you should make a app class that extended from soomla and then extend soomla from push and then push from application class and then set push class in manifest. – Dr.jacky May 19 '15 at 10:09
  • Thanks @Mr.Hyde for reply. But I'm a bit confused. Could you please explain it more clearly? :D Assume I have MainApplication extends Application. Thanks a lot. – Nikel Arteta May 19 '15 at 13:58
  • @NikelArteta MainApplication extends Soomla;;;;;;;;;;;Soomla extends Push;;;;;;;;Push extends Application;;;;;;;;;;; and in Manifest: – Dr.jacky May 21 '15 at 05:05
  • @Mr.Hyde Yes it's what exactly I did and it worked like a charm. Thank you so much. – Nikel Arteta May 21 '15 at 06:37

1 Answers1

0

The solution is you should extends one of your app classes from upper classes (that extended itself from application class or from some app class that extended itself from application class (these are in chain).

In question, you should make a appp class that extended from soomla, and then extend soomla from push, and then push from Application class and then set push class in manifest.

public appp extends Soomla{

}

public soomla extends Push{

}

public push extends Application{

}

In mainfest.xml :

<application
        android:name=".push"
        android:icon="@drawable/ijoomer_luncher_icon"
        android:label="@string/app_name">
Dr.jacky
  • 3,341
  • 6
  • 53
  • 91
  • 1
    @ Mr.Hyde As you said in your question you don't have the sources(in JAR) , so how did you manage to make the extension tree ? – A.Alqadomi Jan 25 '16 at 08:22
  • @A.Alqadomi Yes. you have to make a superClass of that class. Or extends directly from application class of that Jar. Means: `appp extends Soomla.itsCustomMainApplication`;;;;;;;;;;;;;; Or `YourCustomSoomlaMainApplication extends Soomla.itsCustomMainApplication;` and then `appp extends YourCustomSoomlaMainApplication`. – Dr.jacky Nov 28 '17 at 09:11