Skip to content

Instantly share code, notes, and snippets.

@DjakaTechnology
Created March 11, 2019 12:32
Show Gist options
  • Save DjakaTechnology/e051a2ab7f7d6832679c7e5c7bb18506 to your computer and use it in GitHub Desktop.
Save DjakaTechnology/e051a2ab7f7d6832679c7e5c7bb18506 to your computer and use it in GitHub Desktop.
private fun doUpload(fileToUpload: MultipartBody.Part) {
uploadJob = CoroutineScope(Dispatchers.IO).launch {
val result = Request.uploadImg(baseContext, fileToUpload)
withContext(Dispatchers.Main) {
if (result.result == true) onSucceed(result)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment