I have 2 modules in my app: app module (which is the original module) and a second module which hold an activity.
I want to launch the main activity which is in my second module when clicking on a button and get back to my app module's main activity when clicking on another button.
I've tried to do the following but got a ClassNotFoundException:
packageManager.getLaunchIntentForPackage("com.example.secondmodule")?.let {
startActivity(intent)
}
and that:
val intent = Intent(this, Class.forName("com.example.secondmodule.MainActivity"))
startActivity(intent)
and that:
startActivity(Intent("com.example.secondmodule"))
but nothing seems to work, is it even possible ? What can I do to obtain this behavior ?