-
Notifications
You must be signed in to change notification settings - Fork 231
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
java.lang.IllegalStateException: Activity has been destroyed when trying to create BraintreeFragment #104
Comments
@MiralDesai: yes, this is something the SDK should check and handle. Do you have a stacktrace you can share? |
Yup sure can. Here you go:
The line is points too is the line I posted in my opening post.
Not sure what version of the SDK I'm using, the latest because I'm following Braintree's guide
|
@MiralDesai thanks for the report. I've added and fix, it will go out in the next release. |
Thanks, do you have a timeline for the next release? Would be handy to know so I can track it. Since I'm using 2.+ I won't know. |
I don't have a timeline, but it should be some time this week. We have a Google Group that announces releases that you can subscribe to find out when the new version comes out. |
Fantastic thanks. |
I seem to be getting this crash a fair bit when trying to create a new instance of BraintreeFragment with v2 of the SDK. This is because I can initialise a new BraintreeFragment like this:
but the user may have already left the activity, so when the FragmentManager returns and tries to attach the BraintreeFragment to the activity an exception is thrown, because the activity has already been destroyed. Of course this is causing my app to crash.
I assume you guys handle everything to do with the Fragment and it's transactions, so I feel like this is a bug with the SDK in that it's not properly handled. The Fragment should not be attached if the activity has been destroyed.
Let me know what you think.
The text was updated successfully, but these errors were encountered: