Pass values between activities in a type-safe manner.
class A: Activity() {
...
startActivity<B> {
B::value willBe 10
}
...
}
class B: Activity() {
val value: Int by Kin.Int(defaultValue = -1)
fun magicFunction() = Toast.makeText(this, "value = $value", Toast.LENGTH_SHORT).show()
}
Available via JitPack.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
compile 'com.github.moomoon:kin:0.1'
}