Created
June 5, 2019 18:27
-
-
Save dhruvtaneja/ecfa34fcad6f7bab2d6d56419aae245b to your computer and use it in GitHub Desktop.
Handling user's action in onActivityResult
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
companion object { | |
private const val REQUEST_CODE_FLEXI_UPDATE = 17362 | |
} | |
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
if (requestCode == REQUEST_CODE_FLEXI_UPDATE) { | |
when (resultCode) { | |
Activity.RESULT_OK -> { // handle user's approval } | |
Activity.RESULT_CANCELED -> { // handle user's rejection } | |
ActivityResult.RESULT_IN_APP_UPDATE_FAILED -> { // handle update failure } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment