public class

SupportMapFragment

extends Fragment
java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ com.amazon.geo.mapsv2.SupportMapFragment

Class Overview

Represents a Fragment for displaying a map. Use this class if your app is using the SupportLibrary. Otherwise, use MapFragment.

Because this class is a Fragment, it encompasses the View of a map and manages its life cycle.

If useViewLifecycleInFragment(boolean) flag is true, the SupportMapFragment is invalid when it is detached from the Activity, such as after calling the onDestroyView() method. The SupportMapFragment is usable after it is re-attached and onCreateView(LayoutInflater, ViewGroup, Bundle) is called.

Typically you add a SupportMapFragment in the layout XML. For example:

 <fragment android:id="@+id/supportmapfragment_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      class="com.amazon.geo.mapsv2.SupportMapFragment" />
 
 

Summary

Public Constructors
SupportMapFragment()
Public default constructor.
Public Methods
final AmazonMap getMap()
This method is deprecated. Use getMapAsync(OnMapReadyCallback) instead. The callback of that method provides an AmazonMap which is guaranteed to be non-null.
final void getMapAsync(OnMapReadyCallback callback)
Get an AmazonMap asynchronously with a callback after it is ready to be used.
static SupportMapFragment newInstance(AmazonMapOptions options)
Creates a new SupportMapFragment object with the specified map options.
static SupportMapFragment newInstance()
Creates a new SupportMapFragment object with default options.
void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onDestroy()
void onDestroyView()
void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
void onLowMemory()
void onPause()
void onResume()
void onSaveInstanceState(Bundle outState)
[Expand]
Inherited Methods
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener

Public Constructors

public SupportMapFragment ()

Public default constructor. Use newInstance() or newInstance(AmazonMapOptions) to create a SupportMapFragment dynamically.

Public Methods

public final AmazonMap getMap ()

This method is deprecated.
Use getMapAsync(OnMapReadyCallback) instead. The callback of that method provides an AmazonMap which is guaranteed to be non-null.

Gets the map object associated with this SupportMapFragment.

This method returns null if the map is not yet initialized through onCreateView(LayoutInflater, ViewGroup, Bundle). Subsequent calls can return a valid AmazonMap object once the map is initialized.

This method also returns null if the Amazon Maps API library is not available on the device.

Returns
  • An AmazonMap object. Returns null if the map has not been initialized or if the Amazon Maps API library is not available on the device.

public final void getMapAsync (OnMapReadyCallback callback)

Get an AmazonMap asynchronously with a callback after it is ready to be used. The map provided to the callback is guaranteed to be non-null.

This method must be called from the main thread. The callback will be invoked on the main thread.

Parameters
callback The callback to invoke when the map is ready to use.

public static SupportMapFragment newInstance (AmazonMapOptions options)

Creates a new SupportMapFragment object with the specified map options.

Parameters
options An AmazonMapOptions object with the desired initial map options.
Returns
  • The new SupportMapFragment object.

public static SupportMapFragment newInstance ()

Creates a new SupportMapFragment object with default options.

Returns
  • The new SupportMapFragment object.

public void onCreate (Bundle savedInstanceState)

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

public void onDestroy ()

public void onDestroyView ()

public void onInflate (Activity activity, AttributeSet attrs, Bundle savedInstanceState)

public void onLowMemory ()

public void onPause ()

public void onResume ()

public void onSaveInstanceState (Bundle outState)