StreetViewPanoramaView

public classStreetViewPanoramaViewextendsFrameLayout

A View which displays a Street View panorama (with data obtained from the Google Maps service). When focused, it captures keypresses and touch gestures to move the panorama.

Users of this class must forward all the life cycle methods from theActivityor Fragmentcontaining this view to the corresponding ones in this class. In particular, you must forward the following methods:

AStreetViewPanorama must be acquired using getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback).TheStreetViewPanoramaView automatically initializes the Street View system and the view.

For a simpler method of displaying a StreetViewPanorama useStreetViewPanoramaFragment (orSupportStreetViewPanoramaFragment) if you are looking to target earlier platforms.

Note: You are advised not to add children to this view.

Note: The Google Maps SDK for Android does not support multiple StreetViewPanoramaViewobjects in one activity.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

StreetViewPanoramaView(Context context,AttributeSet attrs, int defStyle)

Public Method Summary

void
getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback callback)
Sets a callback object which will be triggered when theStreetViewPanorama instance is ready to be used.
final void
onCreate(Bundle savedInstanceState)
You must call this method from the parent Activity/Fragment's corresponding method.
void
onDestroy()
You must call this method from the parent Activity/Fragment's corresponding method.
final void
onLowMemory()
You must call this method from the parent Activity/Fragment's corresponding method.
final void
onPause()
You must call this method from the parent Activity/Fragment's corresponding method.
void
onResume()
You must call this method from the parent Activity/Fragment's corresponding method.
final void
onSaveInstanceState(BundleoutState)
You must call this method from the parent Activity/Fragment's corresponding method.
void
onStart()
You must call this method from the parent Activity/Fragment's corresponding method.
void
onStop()
You must call this method from the parent Activity/Fragment's corresponding method.

Inherited Method Summary

Public Constructors

publicStreetViewPanoramaView(Context context)

publicStreetViewPanoramaView(Contextcontext, AttributeSet attrs)

publicStreetViewPanoramaView(Contextcontext, AttributeSet attrs, int defStyle)

publicStreetViewPanoramaView(Contextcontext, StreetViewPanoramaOptions options)

Parameters
context The context that will show the view. Must not benull.
options Configuration options for the new view. The view will be configured with default values ifoptionsisnullor any option field is leftnull.

Public Methods

public voidgetStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback callback)

Sets a callback object which will be triggered when theStreetViewPanorama instance is ready to be used.

Note that:

  • In the case where Google Play services is not installed on the user's device, the callback will not be triggered until the user installs it.
  • The callback will be executed in the main thread.
  • TheStreetViewPanorama object provided by the callback is nevernull.
Parameters
callback The callback object that will be triggered when the panorama is ready to be used. Must not benull.

public final voidonCreate(Bundle savedInstanceState)

You must call this method from the parent Activity/Fragment's corresponding method.

public voidonDestroy()

You must call this method from the parent Activity/Fragment's corresponding method.

public final voidonLowMemory()

You must call this method from the parent Activity/Fragment's corresponding method.

public final voidonPause()

You must call this method from the parent Activity/Fragment's corresponding method.

public voidonResume()

You must call this method from the parent Activity/Fragment's corresponding method.

public final voidonSaveInstanceState(BundleoutState)

You must call this method from the parent Activity/Fragment's corresponding method.

public voidonStart()

You must call this method from the parent Activity/Fragment's corresponding method.

public voidonStop()

You must call this method from the parent Activity/Fragment's corresponding method.