如何在 Kotlin 中使用 setComponent 编写以下代码。我是 kotlin 的新手,我可以在哪里使用 Kotlin 启动 kotlin android。
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.android.settings","com.android.settings.Settings$TestingSettingsActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
最佳答案
使用属性引用 :-
intent.component = ComponentName("com.android.settings","com.android.settings.Settings$TestingSettingsActivity")
关于android - 如何在 Kotlin 中使用 intent.setComponent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56509991/