-2
我無法在碎片中使用Google API客戶端。如何在碎片中使用GoogleAPI客戶端
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.layout_case_summary, container, false);
initView(rootView);
return rootView;
if(mGoogleApiClient==null) {
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}
}
「無法訪問的聲明」。你沒有研究這個? –