Skip to content

Instantly share code, notes, and snippets.

@dhruvtaneja
Created May 27, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhruvtaneja/ff0e2b80fa3e9818c2e2febc5a120ec8 to your computer and use it in GitHub Desktop.
Save dhruvtaneja/ff0e2b80fa3e9818c2e2febc5a120ec8 to your computer and use it in GitHub Desktop.
Handling activity lifecycle during immediate in-app update
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