braintree / android-card-form

A ready-made card form layout that can be included in your Android app, making it easy to accept credit and debit cards.
MIT License
366 stars 128 forks source link

Re-set CardForm on CardScanningFragment #52

Closed quinnjn closed 5 years ago

quinnjn commented 5 years ago

CardScanningFragment can be destroyed when the device has low resources. Starting up CardIO is a great example of a low resource case. When this happens the CardScanningFragment loses a reference to the CardForm. To resolve it, the CardForm has to look for the fragment and re-set the reference.

We also needed a mechanism that would prevent the CardScanningFragment from re-creating CardIO on every onCreate call, especially when re-creating.

Fixes #38