I'm using google play services panorama api fir displaying panorama image. Everything works fine but I want to add a layout on top of that view so the image will be used as an activity background.
Here's my code for showing the panoramic view:
@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);
}
}
});
}
The workflow is that I start new activity with the ViewerIntent and I don't have layout control so it just showing the panoramic view.
I'm searching one of the following:
- Getting control of the openning ViewerIntent activity
- Passing a layout to the next activity through bundle
- overriding the panoramic view activity, and populating my own layout
Google street view panorama activity example:

The Panorama API in the Google APIs doesn't seem to have that much feature that you're looking for. Based on the return description of the PanoramaResult (
getViewerIntent),You may have to search for a 3rd party library or create your own implementation on the requirements you need.