Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-如何将本地图像嵌入到活动中并在4.2+;上使用Photo Sphere显示;?_Android_Imageview_Photosphere - Fatal编程技术网

Android-如何将本地图像嵌入到活动中并在4.2+;上使用Photo Sphere显示;?

Android-如何将本地图像嵌入到活动中并在4.2+;上使用Photo Sphere显示;?,android,imageview,photosphere,Android,Imageview,Photosphere,我正在尝试将照片球体图像加载到活动中,并像在图库中一样查看它。我似乎在网络上找不到这个功能的任何例子或示例 关于如何实现这一点的想法、示例、代码集或建议 有关如何从URI加载光球的详细信息: // This listener will be called with information about the given panorama. OnPanoramaInfoLoadedListener infoLoadedListener = new OnPanoramaInfoLoadedLi

我正在尝试将照片球体图像加载到活动中,并像在图库中一样查看它。我似乎在网络上找不到这个功能的任何例子或示例

关于如何实现这一点的想法、示例、代码集或建议

有关如何从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-没有内置的Photo Sphere查看器嵌入到您的
活动中

是否有在任何地方实现此功能的书面示例?@AtomicLock-鉴于您已经看到了文档,并且注意到它说“您应该实例化[全景客户端]在活动的
onCreate(Bundle)
方法中,然后在
onStart()
中调用
connect()
,在
onStop()
中调用
disconnect()
,而不管状态如何。“您还需要什么代码?”?这就是全部。因此,我无法捕获/钩住图像上的用户点击位置,因为它打开了Android viewer,而不是嵌入到活动中的东西(本地)?或者是否可以使用webview并使用一些JavaScript在照片范围内捕获用户点击位置?这可能吗?@AtomicLock-没错。没有办法通过谷歌提供的API在您的
活动中获得交互式照片球体。你当然可以尝试建立自己的基础上,但这不会为心脏虚弱。