In base app, have the Application
class and declared into AndroidManifest.xml
file:
public class App : SplitCompatApplication() {
override fun onCreate() {
super.onCreate()
}
}
<application
android:name=".App"
android:icon="@mipmap/ic_launcher"/>
In dynamic module, which should be downloaded onDemand, have another Application
class.
public class OnDemandApplication : Application() {
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
SplitCompat.install(this)
}
override fun onCreate() {
super.onCreate()
/* compiled code */
}
}
How can I initiate the dynamic module application class?