We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

MapView

public class MapView

Extends FrameLayout and represents a view in which a map is displayed. The view data is obtained from HUAWEI Map Kit.

Public Fields

None.

Constructor

Construction Method
MapView(Context context)
MapView(Context context, AttributeSet attrs)
MapView(Context context, AttributeSet attrs, int defStyle)
MapView(Context context, HuaweiMapOptions options)

Public Method Summary

Return typeMethod name
voidgetMapAsync(OnMapReadyCallback callback)
voidonCreate(Bundle savedInstanceState)
voidonDestroy()
voidonEnterAmbient(Bundle ambientDetails)
voidonExitAmbient()
voidonLowMemory()
voidonPause()
voidonResume()
voidonSaveInstanceState(Bundle outState)
voidonStart()
voidonStop()

Public Methods

Method
public void getMapAsync(OnMapReadyCallback callback)
Obtains a HuaweiMap object.


Parameters:

Parameter nameParameter desc
callbackCallback to be executed when a HuaweiMap object is ready for use.


Return:
None.

Method
public void onCreate(Bundle savedInstanceState)
Called when a map is created. If this method needs to be reloaded, call it from the parent class.


Parameters:

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


Return:
None.

Method
public void onDestroy()
Called when a map is destroyed. If this method needs to be reloaded, call it from the parent class.


Parameters:
None.
Return:
None.

Method
public void onLowMemory()
Called when the memory is insufficient. If this method needs to be reloaded, call it from the parent class.


Parameters:
None.
Return:
None.

Method
public void onPause()
Called when an activity is paused. If this method needs to be reloaded, call it from the parent class.


Parameters:
None.
Return:
None.

Method
public void onResume()
Called when an activity is ready. If this method needs to be reloaded, call it from the parent class.


Parameters:
None.
Return:
None.

Method
public void onSaveInstanceState(Bundle outState)
Called to save the current status of a MapView object upon unexpected exit.
If this method needs to be reloaded, call it from the parent class.


Parameters:

Parameter nameParameter desc
outStateCurrent status of a MapView object.


Return:
None.

Method
public void onStart()
Called when a MapView object is created successfully. Then the map is visible. If this method needs to be reloaded, call it from the parent class.


Parameters:
None.
Return:
None.

Method
public void onStop()
Called when a MapView creation activity exits. Then the map is invisible. If this method needs to be reloaded, call it from the parent class.


Parameters:
None.
Return:
None.

This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.