如何在android中的一个应用程序中的单独jar中有多个应用程序类 [英] how to have multiple application classes in separated jars in one application in android

查看:199
本文介绍了如何在android中的一个应用程序中的单独jar中有多个应用程序类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从Application扩展的Appp类,并在清单中调用Appp。

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

还有另外两个jar,每个作者都说它在清单中称为Application标签。

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

根据如何处理android中的多个应用程序类问题,要从Application扩展多个应用程序类,我们应该从另一个应用程序类扩展一些应用程序类,并在清单中调用上层类。

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?!

推荐答案

解决方案是你应该从上层扩展你的一个app类(扩展自己应用程序类或从某个应用程序类扩展自应用程序类(这些是链中的)。

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).

问题是,你应该创建一个从soomla扩展的appp类,然后从push扩展soomla,然后从Application类推送,然后在manifest中设置push class。

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{

}

在mainfest.xml中:

In mainfest.xml :

<application
        android:name=".push"
        android:icon="@drawable/ijoomer_luncher_icon"
        android:label="@string/app_name">

这篇关于如何在android中的一个应用程序中的单独jar中有多个应用程序类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆