public class

StreetViewPanoramaView

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.google.android.gms.maps.StreetViewPanoramaView

Class Overview

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

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

A StreetViewPanorama must be acquired using getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback). The StreetViewPanoramaView automatically initializes the Street View system and the view.

For a simpler method of displaying a StreetViewPanorama use StreetViewPanoramaFragment (or SupportStreetViewPanoramaFragment) if you are looking to target earlier platforms.

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

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
StreetViewPanoramaView(Context context)
StreetViewPanoramaView(Context context, AttributeSet attrs)
StreetViewPanoramaView(Context context, AttributeSet attrs, int defStyle)
StreetViewPanoramaView(Context context, StreetViewPanoramaOptions options)
Public Methods
final StreetViewPanorama getStreetViewPanorama()
This method is deprecated. Use getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback) instead. The callback method provides you with a StreetViewPanorama instance guaranteed to be non-null and ready to be used.
void getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback callback)
Sets a callback object which will be triggered when the StreetViewPanorama instance is ready to be used.
final void onCreate(Bundle savedInstanceState)
You must call this method from the parent Activity/Fragment's corresponding method.
final 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.
final void onResume()
You must call this method from the parent Activity/Fragment's corresponding method.
final void onSaveInstanceState(Bundle outState)
You must call this method from the parent Activity/Fragment's corresponding method.
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public StreetViewPanoramaView (Context context)

public StreetViewPanoramaView (Context context, AttributeSet attrs)

public StreetViewPanoramaView (Context context, AttributeSet attrs, int defStyle)

public StreetViewPanoramaView (Context context, StreetViewPanoramaOptions options)

Public Methods

public final StreetViewPanorama getStreetViewPanorama ()

This method is deprecated.
Use getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback) instead. The callback method provides you with a StreetViewPanorama instance guaranteed to be non-null and ready to be used.

Gets the underlying StreetViewPanorama that is tied to this view.

Returns
  • the StreetViewPanorama. Null if the view is not yet ready. This can happen when Google Play services is not available. If Google Play services becomes available afterwards, calling this method again will initialize and return the panorama.

public void getStreetViewPanoramaAsync (OnStreetViewPanoramaReadyCallback callback)

Sets a callback object which will be triggered when the StreetViewPanorama 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.
  • The StreetViewPanorama object provided by the callback is non-null.

Parameters
callback The callback object that will be triggered when the panorama is ready to be used.

public final void onCreate (Bundle savedInstanceState)

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

public final void onDestroy ()

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

public final void onLowMemory ()

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

public final void onPause ()

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

public final void onResume ()

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

public final void onSaveInstanceState (Bundle outState)

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