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

Use Application context instead of Activity in Stripe.java #783

Merged
merged 1 commit into from Jan 25, 2019

Conversation

mshafrir-stripe
Copy link
Collaborator

Summary
The crux of this change is making Stripe constructors use
Application context instead of Activity context.

This change also marks instance variables as final and
@NonNull where applicable.

Motivation
Relying on activity context for asynchronous tasks can
lead to memory leaks. We would only need an Activity
context to access the UI, which is not the case for any
of the logic in Stripe.java.

Testing
Interacted with all of the screens in the example app.

**Summary**
The crux of this change is making Stripe constructors use
Application context instead of Activity context.

This change also marks instance variables as `final` and
`@NonNull` where applicable.

**Motivation**
Relying on activity context for asynchronous tasks can
lead to memory leaks. We would only need an Activity
context to access the UI, which is not the case for any
of the logic in Stripe.java.

**Testing**
Interacted with all of the screens in the example app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants