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

Leaked window DecorView #2

Open
andrewpmoore opened this issue Jun 27, 2018 · 3 comments
Open

Leaked window DecorView #2

andrewpmoore opened this issue Jun 27, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@andrewpmoore
Copy link

I'm getting this error:

2018-06-27 16:03:38.323 27998-27998/com.mypossibleself.app E/WindowManager: android.view.WindowLeaked: Activity com.example.SecurityEntryActivity has leaked window DecorView@1635e7a[Security] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:572)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:331)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:97)
        at android.app.Dialog.show(Dialog.java:419)
        at moe.feng.support.biometricprompt.BiometricPromptApi23Impl.authenticate(BiometricPromptApi23Impl.java:133)
        at moe.feng.support.biometricprompt.BiometricPromptCompat.authenticate(BiometricPromptCompat.java:107)

It's triggering when trying to call biometricPrompt.authenticate.

It's only on some phones and only occasionally.

@fython
Copy link
Owner

fython commented Jun 28, 2018

Dialog will be created once when building BiomtericPromptCompat(Api23Impl).

Could it prevent from causing this error if build BiometricPromptCompat every time you want to call authenticate method?

@fython fython added the bug Something isn't working label Jun 28, 2018
@andrewpmoore
Copy link
Author

That is what I'm doing, I've a bioDialog method which has the following in it:

            BiometricPromptCompat biometricPrompt;
            biometricPrompt = new BiometricPromptCompat.Builder(SecurityEntryActivity.this).setTitle(getString(R.string.securityPrompt)).setNegativeButton(getString(R.string.use_password), new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    pinDialog();
                }
            }).build();

            cancellationSignal = new CancellationSignal();
            biometricPrompt.authenticate(cancellationSignal, SecurityEntryActivity.this);

I know it would deviate away from the bioPrompt api, but maybe a way to make a call to dismiss the dialog would help. From reading it may be that when the activity pauses I've got the activity finishing and I've read that the error can happen if your calling finish with a dialog still open.

@fython
Copy link
Owner

fython commented Jun 29, 2018

Thanks for your suggestion. After finishing what I am busy these days, I will fix it.

Sorry for inconvenience. BTW, I am building AbstractBiometricPromptDialogFragment which can keep dialog states for pre-P devices although it's completely not Compat-like (I am thinking how to improve its usage.).

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

2 participants