Advertisement
shyhjie

Untitled

Dec 17th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.78 KB | None | 0 0
  1. GlobalScope.launch(Dispatchers.IO) {
  2.                 try {
  3.                     val result = articleService.postArticle(editText.text.toString(), Uri.parse(paths?.get(0)))
  4.  
  5.                     with(Dispatchers.Main) {
  6.                         this@TuWenActivity.hideProgressDialog()
  7.                         Toast.makeText(this@TuWenActivity, R.string.upload_complete_message, Toast.LENGTH_SHORT).show()
  8.                         var intent = Intent()
  9.                         intent.putExtra("FINISH", true)
  10.                         setResult(RESULT_OK, intent)
  11.                         finish()
  12.                     }
  13.                 } catch (e: Exception) {
  14.                     println(">>>>> $e")
  15.                     this@TuWenActivity.hideProgressDialog()
  16.                 }
  17.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement