use a Fragment as the router to handler the activity result and permission result
dependencies {
implementation 'com.github.yfbx-repo:ResultHelper:2.0.2'
}
- start activity for result
startForResult(Intent()) { code, data ->
if (code == Activity.RESULT_OK && data != null) {
//todo
}
}
- request permission
request(Manifest.permission.WRITE_EXTERNAL_STORAGE) { isGrant ->
if (isGrant) {
//todo
}
}