kingsley
03/05/2017, 3:59 PMfetchData
operation. If that is the case, and the operation isn't cancelable, then you might be better off just using suspendCoroutine
.
Also, if the fetchData operation is a one off, then you probably don't need to remove listener on completion, since it won't be used anymore regardless.
Meanwhile, you should be calling continuation.resumeWithException
in your onError
instead of cancel