title: AndroidNetworking never returns when in suspendCoroutine in Kotlin
body: <p>I am experimenting with the new coroutines and trying to incorporate them into an existing project with some ugly AndroidNetworking api requests.</p>
  
  <p>So my current api requests are using callbacks like this...</p>
  
  <pre><code>fun getSomethingFromBackend(callback: (response: JSONArray?, error: String?) -&gt; Unit) {
    AndroidNetworking.get(...).build().getAsJSONObject(object : JSONObjectRequestListener {
      override fun onResponse(response: JSONObject) { ... }
      override fun onError(error: ANError) { ... }
    }
  }
  </code></pre>
  
  <p>And now I am trying to incorporate coroutines like this...</p>
  
  <pre><code>fun someFunction() = runBlocking {
    async { callGetSomething() }.await()
  }
  
  suspend fun callGetSomething(): JSONObject? = suspendCoroutine {
    Something().getSomethingFromBackend {something
      ...
      it.resume(something)
    }
  }
  </code></pre>
  
  <p>As you can see, I am trying to run the <code>callGetSomething</code> in a coroutine and once there, suspend the coroutine until the async API returns.</p>
  
  <p>My problem is, it never returns. Even if I debug in the <code>onResponse</code>, <code>onError</code>, etc, it never get back from the backend.</p>
  
  <p>But if I remove the <code>= suspendCoroutine</code> it works, at least it returns, but the await will not work off corse, because the execution will just continue.</p>
  
  <p>How can I solve this so the <code>await()</code> actually waits for the async call callback?</p>
  
  <p>Thanks a lot!</p>