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

Constructors call twice #3

Closed
ZaydelEduard opened this issue Jan 25, 2017 · 1 comment
Closed

Constructors call twice #3

ZaydelEduard opened this issue Jan 25, 2017 · 1 comment

Comments

@ZaydelEduard
Copy link

ZaydelEduard commented Jan 25, 2017

If we will use this code in fragment
googlePlusClient = new GooglePlusClient(this);

will call public GooglePlusClient(Fragment fragment) {
and after this will be call public GooglePlusClient(Activity activity) {
as conclusion init method will call twice and will be crashed with

java.lang.IllegalStateException: Already managing a GoogleApiClient with id 0


we can fix this crash if change googlePlusClient = new GooglePlusClient(this); to googlePlusClient = new GooglePlusClient(getActivity); (only activity constructor will be call) , but method onActivityResult call in activity class, not in fragment.

@pavel163
Copy link
Owner

Thank you for the feedback. Fix in 1.0.3

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

No branches or pull requests

2 participants