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]有两个电话/平板电脑模块,希望在另一个模块中启动活动。但是,从设置标志或类别的原因来看,其他模块正在创建不同的应用程序。在同一应用程序中,是否可以在不使用android库模块的情况下从另一个电话/平板电脑模块启动另一个活动?
发布于 2020-06-09 11:30:06
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)这个密码对我有用。
https://stackoverflow.com/questions/62280545
复制相似问题