2013-07-06 49 views

回答

0

announcement posts for the Photo Sphere API細節,你將如何從一個URI加載一個光球:

// This listener will be called with information about the given panorama. 
OnPanoramaInfoLoadedListener infoLoadedListener = 
    new OnPanoramaInfoLoadedListener() { 
    @Override 
    public void onPanoramaInfoLoaded(ConnectionResult result, 
           Intent viewerIntent) { 
     if (result.isSuccess()) { 
      // If the intent is not null, the image can be shown as a 
      // panorama. 
      if (viewerIntent != null) { 
       // Use the given intent to start the panorama viewer. 
       startActivity(viewerIntent); 
      } 
     } 

     // If viewerIntent is null, the image is not a viewable panorama. 
    } 
}; 

// Create client instance and connect to it. 
PanoramaClient client = ... 
... 

// Once connected to the client, initiate the asynchronous check on whether 
// the image is a viewable panorama. 
client.loadPanoramaInfo(infoLoadedListener, panoramaUri); 

注意,這將打開Photo Sphere全景照片在他們的瀏覽器 - 沒有內置在您在Activity嵌入Photo Sphere全景照片查看器。

+0

有沒有在任何地方實施的書面樣本? –

+0

@AtomicLock - 考慮到你已經看過文檔並且注意到「你應該在你的Activity的onCreate(Bundle)'方法中實例化[PanoramaClient],然後在'onStart()'中調用'connect()'並且'onStop()'中的disconnect()',不管狀態如何。「你在找什麼其他代碼?這實際上就是全部。 – ianhanniballake

+0

因此,我無法捕獲/掛鉤用戶在圖像上的點擊位置,因爲它會打開Android查看器而不是嵌入活動(本地)中的東西? –

相關問題