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

Fix - Window Token Exception #26

Closed tiensi closed 7 years ago

tiensi commented 7 years ago

android.view.WindowManager$BadTokenException: occurs when user leaves the form half filled and exits the activity. The expiration date dialog should check if the activity is finishing before deciding to call it's parent show function.

Please let me know if I should change anything, this is my first pull request to another library in a while so I may have made mistakes.

lkorth commented 7 years ago

Thank's for the PR! It looks good, but I am not able to reproduce this exception. Do you have a stack trace you could provide?

tiensi commented 7 years ago

Hi Ikorth, I tried with a few test devices and it seems to occur only on an AT&T Samsung S6. (The verizon samsing s6 doesn't have any issues?!). I'll try to create a sample project so that I can reproduce it and give it to you to test.

lkorth commented 7 years ago

Thanks for the contribution @tiensi!