Last active
March 6, 2019 20:57
-
-
Save shkschneider/7306e508ec2e37f5c8268c8932816e4f to your computer and use it in GitHub Desktop.
This file contains 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
const val ID = "id" | |
class MyActivity : Activity() { | |
private val id1 by extra<String>(ID) // String? | |
private val id2 by extraNotNull<String>(ID) // String | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
requireNotNull(id1, id2) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment