- In Android Studio 3.1 open Run/Debug Configurations
- For the respective Configuration, e.g
app
under General->Launch Options->Launch Flags: add a key-value pair, e.g.--ei DAY_TIME 5
. For more options see: Specification for intent arguments - Read the key-value pair in Kotlin:
// Get the value with intent.extras[KEY_VALUE] which returns a value of type
// Any!. Check for "null" and convert it to a string otherwise return a string