title: Callback with parameters with Kotlin
body: <p>I just started Kotlin so please be nice :) </p>
  
  <p>I have a class that is responsible for fetching some data and notify the main activity that its need to update its UI. </p>
  
  <p>So i have made a function in my DataProvider.kt : </p>
  
  <pre><code>      fun getPeople(fromNetwork: Boolean, results: ((persons: Array&lt;Person&gt;, error: MyError?) -&gt; Unit)) {
  
          // do some stuff stuff
          val map = hashMapOf(
                  "John" to "Doe",
                  "Jane" to "Smith"
          )
  
          var p = Person(map)
          val persons: Array &lt;Person&gt; = arrayOf (p)
          results(persons, null)
      }
  </code></pre>
  
  <p>So i want to call this from my activity but i can't find the right syntax ! : </p>
  
  <pre><code>    DataProvider.getPeople(
              true,
              results =
      )
  </code></pre>
  
  <p>I have try many things but i just want to get my array of persons and my optional error so i can update the UI. </p>
  
  <p>The goal is to perform async code in my data provider so my activity can wait for it. </p>
  
  <p>Any ideas ? Thank you very much for any help. </p>