我想做这样的事情:(代码在java中)
Pair[] pairs = new Pair[1];
Run Code Online (Sandbox Code Playgroud)
我想将此代码转换为 kotlin,问题是我不知道如何初始化此数组。这是我的代码:
val prof_intent = Intent(this, NewObjectiveActivity::class.java)
val pairs = arrayOf(1)
pairs[0] = Pair<View, String>(fabNewObjective, "activity_trans")
val options = ActivityOptions.makeSceneTransitionAnimation(this, pairs)
startActivity(prof_intent, options.toBundle())
Run Code Online (Sandbox Code Playgroud)