java.lang.Object | ||
↳ | android.app.Fragment | |
↳ | com.google.android.gms.maps.StreetViewPanoramaFragment |
A StreetViewPanorama component in an app. This fragment is the simplest way to place a Street View panorama in an application. It's a wrapper around a view of a panorama to automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity's layout file simply with the XML below.
<fragment class="com.google.android.gms.maps.StreetViewPanoramaFragment" android:layout_width="match_parent" android:layout_height="match_parent"/>A
StreetViewPanorama
must be acquired using
getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback)
.
The StreetViewPanoramaFragment
automatically initializes the Street View system and the
view.
A view can be removed when the StreetViewPanoramaFragment's onDestroyView()
method is
called and the useViewLifecycleInFragment(boolean)
option is
set. When this happens the StreetViewPanoramaFragment is no longer valid until the view is
recreated again later when MapFragment's onCreateView(LayoutInflater, ViewGroup, Bundle)
method is called.
Any object obtained from the StreetViewPanorama
is associated with the view. It's
important to not hold on to objects beyond the view's life. Otherwise it will cause a memory leak
as the view cannot be released.
Use this class only if you are targeting API 12 and above. Otherwise, use SupportStreetViewPanoramaFragment.
[Expand]
Inherited Constants | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.content.ComponentCallbacks2
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a streetview panorama fragment.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| |||||||||||
Sets a callback object which will be triggered when the
StreetViewPanorama instance
is ready to be used.
| |||||||||||
Creates a streetview panorama fragment, using default options.
| |||||||||||
Creates a streetview panorama fragment with the given options.
| |||||||||||
Parse attributes during inflation from a view hierarchy into the arguments we handle.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.app.Fragment
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From class
java.lang.Object
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface
android.content.ComponentCallbacks
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface
android.content.ComponentCallbacks2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From interface
android.view.View.OnCreateContextMenuListener
|
Creates a streetview panorama fragment. This constructor is public only for use by an
inflater. Use newInstance()
to create a StreetViewPanoramaFragment programmatically.
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 the view wrapped by this fragment.
onCreateView(LayoutInflater, ViewGroup, Bundle)
yet. This can also happen if
Google Play services is not available. If Google Play services becomes available
afterwards and the fragment have gone through
onCreateView(LayoutInflater, ViewGroup, Bundle)
, calling this method again
will initialize and return the StreetViewPanorama.
Sets a callback object which will be triggered when the StreetViewPanorama
instance
is ready to be used.
Note that:
StreetViewPanorama
object provided by the callback is non-null.
callback | The callback object that will be triggered when the panorama is ready to be used. |
---|
Creates a streetview panorama fragment, using default options.
Creates a streetview panorama fragment with the given options.
Parse attributes during inflation from a view hierarchy into the arguments we handle.