我正在使用谷歌播放服务全景api菲尔显示全景图像。一切都很好,但是我想在视图的顶部添加一个布局,这样图像就可以用作活动背景。
下面是我展示全景视图的代码:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mClient = new GoogleApiClient.Builder(this, this, this)
.addApi(Panorama.API)
.build();
}
@Override
public void onConnected(Bundle bundle) {
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.pano1);
Panorama.PanoramaApi.loadPanoramaInfo(mClient, uri).setResultCallback(
new ResultCallback<PanoramaApi.PanoramaResult>() {
@Override
public void onResult(PanoramaApi.PanoramaResult result) {
if (result.getStatus().isSuccess()) {
Intent viewerIntent = result.getViewerIntent();
Log.i(TAG, "found viewerIntent: " + viewerIntent);
if (viewerIntent != null) {
startActivity(viewerIntent);
}
} else {
Log.e(TAG, "error: " + result);
}
}
});
}工作流程是使用ViewerIntent启动新的活动,并且没有布局控制,所以它只显示全景视图。
我正在搜索以下内容之一:
谷歌街景全景活动示例:

发布于 2016-02-10 02:54:30
Google中的Panorama API似乎没有你想要的那么多功能。基于PanoramaResult (getViewerIntent)的返回描述,
如果图像是全景图,则不为空,启动时将启动查看器。如果图像不是全景图,则为空。
您可能需要搜索第三方库,或者根据需要创建自己的实现。
https://stackoverflow.com/questions/35295303
复制相似问题