2016-09-19 27 views
0

當我嘗試使用Panorama.PanoramaApi.loadPanoramaInfo(),的iget以下錯誤:GoogleApiClient未配置爲使用Panorama

09-19 18:30:30.009 18751-18751/com.my.example E/AndroidRuntime: FATAL EXCEPTION: main 
                   Process: com.my.example, PID: 18751 
                   java.lang.IllegalArgumentException: GoogleApiClient is not configured to use the API required for this call. 
                    at com.google.android.gms.common.internal.zzab.zzb(Unknown Source) 
                    at com.google.android.gms.internal.zzpy.zzc(Unknown Source) 
                    at com.google.android.gms.internal.zzuw.loadPanoramaInfo(Unknown Source) 
                    at com.ndguide.imageslideshow.adapter.poiSlideAdapter$1.onClick(poiSlideAdapter.java:62) 
                    at android.view.View.performClick(View.java:5204) 
                    at android.view.View$PerformClick.run(View.java:21153) 
                    at android.os.Handler.handleCallback(Handler.java:739) 
                    at android.os.Handler.dispatchMessage(Handler.java:95) 
                    at android.os.Looper.loop(Looper.java:148) 
                    at android.app.ActivityThread.main(ActivityThread.java:5417) 
                    at java.lang.reflect.Method.invoke(Native Method) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

我的代碼是

if (uri != null) { 
    Panorama.PanoramaApi.loadPanoramaInfo(site.getGoogleApiClient(), uri).setResultCallback(
      new ResultCallback<PanoramaResult>() { 
       @Override 
       public void onResult(PanoramaResult result) { 
        if (result.getStatus().isSuccess()) { 
         Intent viewerIntent = result.getViewerIntent(); 
         Log.i(Constants.APP_TAG, "found viewerIntent: " + viewerIntent); 
         if (viewerIntent != null) { 
          site.getMainActivity().startActivity(viewerIntent); 
         } 
        } else { 
         Log.e(Constants.APP_TAG, "error: " + result); 
        } 
       } 
      } 
    ); 
} 

我明白,我不得不去谷歌API控制檯啓用Panorama API,但我沒有找到它。

如何解決它?

回答

相關問題