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

后端 未结 10 1948
独厮守ぢ
独厮守ぢ 2020-12-13 08:16

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

FATAL EXCEPTION: main
Process         


        
10条回答
  •  萌比男神i
    2020-12-13 08:55

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

    @Override
    public void onPause() {
        super.onPause();
    
        mGoogleApiClient.stopAutoManage(getActivity());
        mGoogleApiClient.disconnect();
    }
    

提交回复
热议问题