How to force a callback to returns the result right away in kotlin?
I have a callback function that is async and takes some time to return the result. How can i force it to wait for the result and then go to the next line of the code.
var result = false
settings.areAllTheSettingsGranted { isGranted ->
result = isGranted as Boolean
}
// I don't want to come to the next line unless the value has changed.
I need the value of the "result" before going to the next line"