The problem is that you are not passing the function as a parameter to the method uploadImageToParse. You pass the result. In addition, the method uploadImageToParseexpects Unit tosafeCall be not a function.
To do this, you first need to declare an uploadImageToParseexpect function parameter.
fun uploadImageToParse(file: String?, saveCall: () -> Unit) {
saveCall()
}
Then you can pass the parameters of the function to this method.
uploadImageToParse(imageFile, {saveCall()})
For more information about the topic, see Higher Order Functions and Lambdas in the Kotlin documentation.
: @marstran, , .
uploadImageToParse(imageFile, ::saveCall)