I have View and one CircleShape , which should show toast in this View. And I use it in main Activity. This is my interface
interface OnClickListenerInterfa
define a function like this:
fun performWork(param1: String, myCallback: (result: String?) -> Unit) { // perform some network work // on network finished myCallback.invoke("result from network") }
use like this:
performWork("http://..."){ result -> //use result }