Created
May 27, 2019 17:25
-
-
Save dhruvtaneja/ff0e2b80fa3e9818c2e2febc5a120ec8 to your computer and use it in GitHub Desktop.
Handling activity lifecycle during immediate in-app update
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
override fun onResume() { | |
super.onResume() | |
appUpdateManager.appUpdateInfo.addOnSuccessListener { | |
if (it.updateAvailability() == UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS) { | |
appUpdateManager.startUpdateFlowForResult( | |
it, | |
AppUpdateType.IMMEDIATE, | |
this, | |
REQUEST_CODE_FLEXI_UPDATE | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment