Skip to content

Instantly share code, notes, and snippets.

@teegarcs
Created August 16, 2020 12:02
Show Gist options
  • Save teegarcs/d34daa6b7367702c8a3f57ce5ba7011c to your computer and use it in GitHub Desktop.
Save teegarcs/d34daa6b7367702c8a3f57ce5ba7011c to your computer and use it in GitHub Desktop.
class MessageActivity : AppCompatActivity() {
.......
/**
* launched via onClick in the XML
* sets this finishing activity's result to the text string
* entered by the user
*/
fun onSubmitMessage(view: View) {
val result = Intent().putExtra(MessageContract.MESSAGE,
mBinding.messageInput.text.toString())
setResult(Activity.RESULT_OK, result)
finish()
}
.......
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment