-
-
Save gtomek/242c3de7dc319daf04a4f37ed0a283c2 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
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