0

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?

Sandip
  • 293
  • 3
  • 17
  • How do you expect that to work? An app has a single Application class. You can't have multiple – Ivo Feb 11 '22 at 07:59
  • yes, but some function need to initialize from application class in dynamic module. how can I do that? – Sandip Feb 11 '22 at 08:02

0 Answers0