Kotlin Global Function:
fun Activity.showWarningDialog(title: Int, description: Int,done:()->Unit) {
done()
}
calling this in java:
showWarningDialog(this,R.string.alert,R.string.leave_without_saving,() -> {
setResult(RESULT_CANCELED);
finish();
});
it gives the following error: Cannot resolve method 'showWarningDialog(com.us.stickermaker.backgroundRemover.CutOutActivity, int, int, <lambda expression>)'
the function is imported into the activity file, works fine if we remove the lambda parameter.