2013-05-06 52 views

回答

3

您必須使用PanoramaClient(它是Google Play Services的一部分)才能打開PhotoSphere照片。

如何做到這一點的例子可以在this Android developer blog post發現:

// 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); 
+0

您好,感謝您的輸入。現在我正在嘗試關注[this](http://my.fit.edu/~vkepuska/ece5570/adt-bundle-windows-x86_64/sdk/extras/google/google_play_services/samples/panorama/src/com/ google/android/gms/samples/panorama/PanoramaSampleActivity.java)示例,我更改了這樣一行:Uri uri = Uri.parse(「android.resource://」+ getPackageName()+「/」+ R. raw.pano1);對於該行:Uri uri = Uri.parse(「https://dl.dropboxusercontent.com/u/24891617/The%20Slip/pano1.jpeg」.toString());問題是它沒有加載任何東西。你怎麼看? – 2013-05-06 18:01:37

+0

鏈接被破壞,你的意思是這個鏈接? https://stuff.mit.edu/afs/sipb/project/android/OldFiles/sdk/android-sdk-linux/extras/google/google_play_services/docs/reference/com/google/android/gms/panorama/PanoramaClient。 html – 2015-11-06 15:45:13

+1

@BartBurg - 它已被替換爲[PanoramaApi](https://developers.google.com/android/reference/com/google/android/gms/panorama/PanoramaApi) – ianhanniballake 2015-11-06 16:14:00

相關問題