Last active
May 3, 2018 13:30
-
-
Save douglasiacovelli/45f0fe99f57fce66a5082f75760c5854 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListActivity: AppCompatActivity { | |
private val REQUEST_FORM = 1 | |
onCreate(...){...} | |
fun startFormActivity() {...} | |
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
// check if the requestCode is the wanted one and if the result is what we are expecting | |
if (requestCode == REQUEST_FORM && resultCode == RESULT_OK) { | |
val name = data?.getStringExtra(FormActivity.INPUT_NAME) | |
addItemToList(name) // do something with the value | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment