Android library written in Kotlin to simplify starting activities for result.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.cregus:inline-activity-result:1.0'
}
startActivityForResult
functions can be started from FragmentActivity or Fragment.
startActivityForResult(intent) { result ->
if (result.isOk()) {
val resultIntent = result.intent
// Do something with result intent.
}
}
val extras = Bundle()
extras.putInt("ID", 1)
startActivityForResultOk<SampleActivity>(extras) { result ->
val resultIntent = result.intent
// Do something with result intent.
}