Closed mtotschnig closed 3 years ago
While the return value of the protected callResultListener
is indeed (currently) not used, the return value of onResult
is very much used inside the callResultListener
:
It is used to decide whether the result was handled or not. If not, it will be passed to the other fragments or activity inside the hierarchy until it finally got handled. For most use cases this might not be relevant, but if you work with (nested) fragments in your activity then it is important. The library itself requires this mechanism e.g. for the color palette dialogs from which you can open a "nested" color picker dialog.
thank you for the explanation. sorry for having overlooked this.
No problem, you're welcome :)
If I am not mistaken the value returned from the onResult callback has no effect. onResult is only used from callResultListener, and the return value of callResultListener is always ignored. Wouldn't it make sense to redesign the API and have onResult as a void function?