Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] force update closing on back button. #39

Open
onirban27 opened this issue Mar 8, 2020 · 3 comments
Open

[BUG] force update closing on back button. #39

onirban27 opened this issue Mar 8, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@onirban27
Copy link

Describe the bug
force update is closing when hardware back button is pressed.
To Reproduce
Steps to reproduce the behavior:

  1. trigger force update
  2. Click on back button
  3. force update window closes.

Expected behavior
force update is needed so that old version are updated forcefully. user can still close the window and use old version.

Additional context
my main activity has onBackPress() which helps user to exit app for twice clicks.

@onirban27 onirban27 added the bug Something isn't working label Mar 8, 2020
@cmy82
Copy link

cmy82 commented Feb 24, 2021

You have to handle that in the onActivityResult method of your activity, that can't be controlled in the library.

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        when (requestCode) {
            UpdateManagerConstant.REQUEST_CODE -> {
                when(resultCode){
                    Activity.RESULT_OK -> {

                    }
                    Activity.RESULT_CANCELED -> {
                        if(updateMgr?.mode == UpdateManagerConstant.IMMEDIATE) finish()
                    }
                    ActivityResult.RESULT_IN_APP_UPDATE_FAILED -> {
                        
                    }
                }
            }
        }
    }

@mjjabarullah
Copy link

UpdateManagerConstant.REQUEST_CODE accessing this from the library it shows package private is not accessible.

@akhileshsharma
Copy link

Unable to register updatemanger For Activity Result, moreover onActivityResult is deprecated now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants