目录

public class SupportMapFragment

A map component in an app. It can be used to place a map in an app in the simplest way. To automatically initialize the map system and view, call getMapAsync.

Public Fields

None.

Constructor

Construction Method
SupportMapFragment()

Public Method Summary

Return typeMethod name
voidgetMapAsync(OnMapReadyCallback callback)
static SupportMapFragmentnewInstance(HuaweiMapOptions options)
static SupportMapFragmentnewInstance()
voidonActivityCreated(Bundle savedInstanceState)
voidonAttach(Activity activity)
voidonCreate(Bundle savedInstanceState)
ViewonCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
voidonDestroy()
voidonDestroyView()
final voidonExitAmbient()
final voidonEnterAmbient(Bundle ambientDetails)
voidonInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
voidonLowMemory()
voidonPause()
voidonResume()
voidonSaveInstanceState(Bundle outState)
voidonStart()
voidonStop()
voidsetArguments(Bundle args)

Public Methods

Method
public void getMapAsync(OnMapReadyCallback callback)
Sets a callback object, which will be triggered to obtain a HuaweiMap object when it is ready for use.


Parameters:

Parameter nameParameter desc
callbackCallback to be triggered when a map is ready for use.


Return:
None.


Method
public static SupportMapFragment newInstance(HuaweiMapOptions options)
Creates a SupportMapFragment object with specified attributes.


Parameters:

Parameter nameParameter desc
optionsAttributes required for creating a SupportMapFragment object.


Return:

Return typeParameter desc
SupportMapFragmentSupportMapFragment object.
Method
public static SupportMapFragment newInstance()
Creates a SupportMapFragment object with default attributes.


Parameters:
None.
Return:

Return typeParameter desc
SupportMapFragmentSupportMapFragment object.
Method
public void onActivityCreated(Bundle savedInstanceState)
Lifecycle method inherited from android.app.Fragment.


Parameters:

Parameter nameParameter desc
savedInstanceStateStatus to be saved for a SupportMapFragment object.


Return:
None.


Method
public void onAttach(Activity activity)
Lifecycle method inherited from android.app.Fragment.


Parameters:

Parameter nameParameter desc
activityActivity object bound to SupportMapFragment.


Return:
None.


Method
public void onCreate(Bundle savedInstanceState)
Lifecycle method inherited from android.app.Fragment.


Parameters:

Parameter nameParameter desc
savedInstanceStateStatus to be saved for a SupportMapFragment object.


Return:
None.


Method
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Lifecycle method inherited from android.app.Fragment.


Parameters:

Parameter nameParameter desc
inflaterLayoutInflater object, which is used to search for controls in a layout.
containerLayout container.
savedInstanceStateStatus to be saved for a SupportMapFragment object.


Return:

Return typeParameter desc
ViewView object.
Method
public void onDestroy()
Lifecycle method inherited from android.app.Fragment.


Parameters:
None.
Return:
None.

Method
public void onDestroyView()
Lifecycle method inherited from android.app.Fragment.


Parameters:
None.
Return:
None.

Method
public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)
Inherited from android.app.Fragment and called when SupportMapFragment is statically loaded in XML mode.


Parameters:

Parameter nameParameter desc
activityActivity object bound to SupportMapFragment.
attrsAttributes used to create a SupportMapFragment object.
savedInstanceStateStatus to be saved for a SupportMapFragment object.


Return:
None.

Method
public void onLowMemory()
Inherited from android.app.Fragment and called when the memory is insufficient.


Parameters:
None.
Return:
None.

Method
public void onPause()
Lifecycle method inherited from android.app.Fragment.


Parameters:
None.
Return:
None.

Method
public void onResume()
Lifecycle method inherited from android.app.Fragment.


Parameters:
None.
Return:
None.

Method
public void onSaveInstanceState(Bundle outState)
Inherited from android.app.Fragment and called when Fragment is destroyed unexpectedly. This method is used to save the status of a SupportMapFragment object before it is destroyed. Then you can retrieve the status when calling onCreate(Bundle) again.


Parameters:

Parameter nameParameter desc
outStateStatus to be saved for a SupportMapFragment object.


Return:
None.

Method
public void onStart()
Lifecycle method inherited from android.app.Fragment.


Parameters:
None.
Return:
None.

Method
public void onStop()
Lifecycle method inherited from android.app.Fragment.


Parameters:
None.
Return:
None.

Method
public void setArguments(Bundle args)
Inherited from android.app.Fragment and called when data needs to be passed to Fragment.


Parameters:

Parameter nameParameter desc
argsData to be passed to SupportMapFragment.


Return:
None.