目录

TextureMapFragment

Class Info

public class TextureMapFragment extends Fragment

Map component inherited from Fragment, which is the simplest way for placing a map in an app. It provides a view of a map to manage the map lifecycle, and can be loaded to the layout file of Activity for use. To obtain the map manager, call getMapAsync.

CAUTION:

TextureMapFragment cannot be used together with MapFragment, MapView, and SupportMapFragment.

Public Constructor Summary

Constructor Name

TextureMapFragment()

Default constructor of the TextureMapFragment class.

Public Method Summary

Qualifier and Type

Method Name and Description

void

getMapAsync(OnMapReadyCallback callback)

Obtains a HuaweiMap object when the object is ready.

static TextureMapFragment

newInstance()

Creates a TextureMapFragment object with default attributes.

static TextureMapFragment

newInstance(HuaweiMapOptions options)

Creates a TextureMapFragment object based on the specified options.

void

onActivityCreated(Bundle savedInstanceState)

Lifecycle method inherited from MapFragment.

void

onAttach(Activity activity)

Lifecycle method inherited from MapFragment.

void

onCreate(Bundle savedInstanceState)

Lifecycle method inherited from MapFragment.

View

onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Lifecycle method inherited from MapFragment.

void

onDestroy()

Lifecycle method inherited from MapFragment.

void

onDestroyView()

Lifecycle method inherited from MapFragment.

void

onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState)

Lifecycle method inherited from MapFragment. This method is called when Fragment is statically loaded in XML mode.

void

onLowMemory()

Lifecycle method inherited from MapFragment. This method is called when the memory is insufficient.

void

onPause()

Lifecycle method inherited from MapFragment.

void

onResume()

Lifecycle method inherited from MapFragment.

void

onSaveInstanceState(Bundle outState)

Lifecycle method inherited from MapFragment and called when TextureMapFragment is destroyed unexpectedly. It is used to save the status of a TextureMapFragment object before it is destroyed.

void

onStart()

Lifecycle method inherited from MapFragment.

void

onStop()

Lifecycle method inherited from MapFragment.

void

setArguments(Bundle args)

Lifecycle method inherited from MapFragment and called when data needs to be passed to TextureMapFragment.

Public Methods

[h2]getMapAsync

Method

public void getMapAsync(OnMapReadyCallback callback)

Obtains a HuaweiMap object when the object is ready.

Parameters

Name

Description

callback

Callback to be executed when a HuaweiMap object is ready for use.

[h2]newInstance()

Method

public static TextureMapFragment newInstance()

Creates a TextureMapFragment object with default attributes.

Returns

Type

Description

TextureMapFragment

TextureMapFragment object.

[h2]newInstance(HuaweiMapOptions options)

Method

public static TextureMapFragment newInstance(HuaweiMapOptions options)

Creates a TextureMapFragment object based on the specified options.

Parameters

Name

Description

options

Attributes required for creating a HuaweiMapOptions object.

Returns

Type

Description

TextureMapFragment

TextureMapFragment object.

[h2]onActivityCreated

Method

public void onActivityCreated(Bundle savedInstanceState)

Lifecycle method inherited from MapFragment.

Parameters

Name

Description

savedInstanceState

Status to be saved for a TextureMapFragment object.

[h2]onAttach

Method

public void onAttach(Activity activity)

Lifecycle method inherited from MapFragment.

Parameters

Name

Description

activity

Activity object bound to TextureMapFragment.

[h2]onCreate

Method

public void onCreate(Bundle savedInstanceState)

Lifecycle method inherited from MapFragment.

Parameters

Name

Description

savedInstanceState

Status to be saved for a TextureMapFragment object.

[h2]onCreateView

Method

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

Lifecycle method inherited from MapFragment.

Parameters

Name

Description

inflater

LayoutInflater object, which is used to search for controls in a layout.

container

Layout container.

savedInstanceState

Status to be saved for a TextureMapFragment object.

Returns

Type

Description

View

View object.

[h2]onDestroy

Method

public void onDestroy()

Lifecycle method inherited from MapFragment.

[h2]onDestroyView

Method

public void onDestroyView()

Lifecycle method inherited from MapFragment.

[h2]onInflate

Method

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

Lifecycle method inherited from MapFragment. This method is called when Fragment is statically loaded in XML mode.

Parameters

Name

Description

activity

Activity object bound to TextureMapFragment.

attrs

Attributes used to create a TextureMapFragment object.

savedInstanceState

Status to be saved for a TextureMapFragment object.

[h2]onLowMemory

Method

public void onLowMemory()

Lifecycle method inherited from MapFragment. This method is called when the memory is insufficient.

[h2]onPause

Method

public void onPause()

Lifecycle method inherited from MapFragment.

[h2]onResume

Method

public void onResume()

Lifecycle method inherited from MapFragment.

[h2]onSaveInstanceState

Method

public void onSaveInstanceState(Bundle outState)

Lifecycle method inherited from MapFragment and called when TextureMapFragment is destroyed unexpectedly. It is used to save the status of a TextureMapFragment object before it is destroyed.

Parameters

Name

Description

outState

Status to be saved for a TextureMapFragment object.

[h2]onStart

Method

public void onStart()

Lifecycle method inherited from MapFragment.

[h2]onStop

Method

public void onStop()

Lifecycle method inherited from MapFragment.

[h2]setArguments

Method

public void setArguments(Bundle args)

Lifecycle method inherited from MapFragment and called when data needs to be passed to TextureMapFragment.

Parameters

Name

Description

args

Data to be passed to TextureMapFragment.