val intent = Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_HOME)
.setClassName( "com.example.AnotherPhoneTabletModule","com.example.AnotherPhoneTabletModule.MainActivity")
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.addFlags(Intent.FLAG_FROM_BACKGROUND)
.setComponent(ComponentName("com.example.AnotherPhoneTabletModule", "com.example.AnotherPhoneTabletModule.MainActivity"))
applicationContext.startActivity(intent)[1]
There are two phone/tablet modules and want to do start activity in another module. However, from the reason of setting flag or category the other module is creating different application. Is it possible in same application to start another activity from another phone/tablet module without using android library module.
val intent = Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_HOME).setClassName("com.example.AnotherPhoneTabletModule","com.example.AnotherPhoneTabletModule.MainActivity")
.setComponent(ComponentName("com.example.AnotherPhoneTabletModule", "com.example.AnotherPhoneTabletModule.MainActivity"))
startActivity(intent)
This code worked for me.