2016-12-04 9 views
1

Google APIクライアントを使用して最後の既知の場所を取得しようとしていますが、互換性がないという問題があります。誰かが私が逃したことを指摘できますか?互換性のない型。必須:GoogleApiClientが見つかりました:GoogleApiClient.Builder

import android.support.v4.app.FragmentActivity; 
import android.os.Bundle; 

import com.google.android.gms.common.ConnectionResult; 
import com.google.android.gms.common.api.GoogleApiClient; 
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; 
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.OnMapReadyCallback; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.LatLng; 
import com.google.android.gms.maps.model.MarkerOptions; 

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, OnConnectionFailedListener, 
     ConnectionCallbacks{ 

    private GoogleMap mMap; 
    private GoogleApiClient mGoogleApiClient; 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_maps); 

     // getting incompatible issue in below line 
     mGoogleApiClient = new GoogleApiClient.Builder(this); 

     // Obtain the SupportMapFragment and get notified when the map is ready   to be used. 
     SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() 
       .findFragmentById(R.id.map); 
     mapFragment.getMapAsync(this); 
    } 

答えて

0

これを試してください。

 mGoogleApiClient = new GoogleApiClient.Builder(this).build(); 
関連する問題