Skip to content
Advertisement

Error in Fragment: “Already managing a GoogleApiClient with id 0”

Everything works right the first time, if you launch a second time you see this error:

JavaScript

Here’s my code:

JavaScript

As I understand it, the problem is in these lines:

JavaScript

I tried explicitly passing an id of 0:

JavaScript

but that still didn’t work.

What am I missing?

Advertisement

Answer

You should call stopAutoManage() in the onPause() method of your Fragment:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement