Open sourced `TypedBundle` for Android development...
# androidgithubprojects
j
Open sourced
TypedBundle
for Android development - https://github.com/Jintin/TypedBundle/ Example usage:
Copy code
val textKey = StringKey("SomeStringKey")
val intKey = IntKey("SomeIntKey")
val bundle = Bundle()

bundle.put(textKey, "Some text")   // only String value is acceptable
bundle.put(intKey, 12345)          // only Int value is acceptable

val text = bundle.get(textKey, "") // guarantee result to be a String  
val int = bundle.get(intKey, -1)   // guarantee result to be an Int