Is there another way to connect Google API client?
I use auto complete places and I have to use this code some where in MYFRAGMENT
mGoogleApiClient = new GoogleApiClient.Builder(MainActivity.this)
.addApi(Places.GEO_DATA_API)
.enableAutoManage(this, GOOGLE_API_CLIENT_ID, this)
.addConnectionCallbacks(this).build();
My problem with
enableAutoManage(this, GOOGLE_API_CLIENT_ID, this)
.addConnectionCallbacks(this).build();
I can't deal with it because when I replace this
with getActivity()
I have many problem with casting
thanks for help and sorry if this question is silly.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…