Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

CRASH: on save instance state exception #39

Closed
br00 opened this issue Oct 12, 2016 · 2 comments
Closed

CRASH: on save instance state exception #39

br00 opened this issue Oct 12, 2016 · 2 comments

Comments

@br00
Copy link

br00 commented Oct 12, 2016

Hi,
To make it crash do this:

  • authenticate with your finger
  • the animation with "Fingerprint recognised" text is shown
  • because that animation has 1 sec of delay before calling the callback mCallback.onAuthenticated();
  • if you send the app in background during the animation then it crash (just press home button before the animation is gone)

The issue is that are missing some checks when you call dismiss()

@OverRide
public void onAuthenticated() {
// Callback from FingerprintUiHelper. Let the activity know that authentication was
// successful.
mActivity.onPurchased(true /* withFingerprint */, mCryptoObject);
dismiss();
}

I suggest to put
Activity anActivity = getActivity();
if (getDialog() != null && getDialog().isShowing() && isResumed() && anActivity != null && !anActivity.isFinishing()) {
dismiss();
}

or you can use dismissAllowingStateLoss()

@usantos
Copy link

usantos commented Jul 4, 2019

If you use dismissAllowingStateLoss ()
would it be after the dismiss?

@codingjeremy
Copy link
Contributor

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants