2013-05-06 23 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

相关问题