Redundant SAM-constructor can't be remove for Kotlin declared function, but works on Java declared function

前端 未结 2 621
渐次进展
渐次进展 2021-01-04 23:29

I have a Java Class function as below

public void setPositiveButton(int resId, DialogInterface.OnClickListener listener) 

I also have the s

2条回答
  •  隐瞒了意图╮
    2021-01-05 00:05

    Extending @humazed answer as compiler complains that

    lambda argument should be moved out of parenthesis

    setPositiveButton("ok"){_,_ -> doSomething()}
    

提交回复
热议问题