我在清单
中添加了第一个继承的类 <application
android:name=".GlobalApplication"
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
我想添加第二个应用程序ModelViewerApplication.class
继承的类,因为我必须使用两个应用程序继承的类。
答案 0 :(得分:1)
不幸的是<application>
不支持多个Application
类。如果您想要添加第二个类Application
,那么您可以做的最好是:
public class SecondClass extends GlobalApplication {
...
}
在你的清单中
<application
android:name=".SecondClass"
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
>