Class Info |
|---|
public class TextureMapFragment extends Fragment 是一个地图组件,继承安卓原生Fragment,是应用中放置地图的最简单的方式。它提供了一个地图界面,管理地图生命周期,能够加载到Activity的布局文件中使用。通过getMapAsync,获取地图管理器。 注意: TextureMapFragment不能与MapFragment、MapView、SupportMapFragment混用。 |
Qualifier and Type | Method Name and Description |
|---|---|
void | getMapAsync(OnMapReadyCallback callback) 当地图对象准备就绪时,就会触发此接口回调,获取HuaweiMap对象。 |
static TextureMapFragment | 通过默认方式创建TextureMapFragment对象。 |
static TextureMapFragment | newInstance(HuaweiMapOptions options) 使用给定的options创建TextureMapFragment对象。 |
void | onActivityCreated(Bundle savedInstanceState) 继承自MapFragment的生命周期方法。 |
void | onAttach(Activity activity) 继承自MapFragment的生命周期方法。 |
void | onCreate(Bundle savedInstanceState) 继承自MapFragment的生命周期方法。 |
View | onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 继承自MapFragment的生命周期方法。 |
void | 继承自MapFragment的生命周期方法。 |
void | 继承自MapFragment的生命周期方法。 |
void | onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState) 继承自MapFragment的生命周期方法,Fragment以XML方式静态加载时调用。 |
void | 继承自MapFragment的生命周期方法,内存低时调用。 |
void | onPause() 继承自MapFragment的生命周期方法。 |
void | onResume() 继承自MapFragment的生命周期方法。 |
void | onSaveInstanceState(Bundle outState) 继承自MapFragment的生命周期方法,TextureMapFragment异常销毁时调用,用来存储TextureMapFragment在销毁之前的状态。 |
void | onStart() 继承自MapFragment的生命周期方法。 |
void | onStop() 继承自MapFragment的生命周期方法。 |
void | setArguments(Bundle args) 继承自MapFragment的生命周期方法,当需要向TextureMapFragment传递数据时调用。 |
Method |
|---|
public void getMapAsync(OnMapReadyCallback callback) 当地图对象准备就绪时,就会触发此接口回调,获取HuaweiMap对象。 |
Parameters
Name | Description |
|---|---|
callback | HuaweiMap可以使用时的回调。 |
Method |
|---|
public static TextureMapFragment newInstance() 通过默认方式创建TextureMapFragment对象。 |
Returns
Type | Description |
|---|---|
TextureMapFragment | TextureMapFragment对象。 |
Method |
|---|
public static TextureMapFragment newInstance(HuaweiMapOptions options) 使用给定的options创建TextureMapFragment对象。 |
Parameters
Name | Description |
|---|---|
options | 用于获取HuaweiMapOptions对象所需的参数。 |
Returns
Type | Description |
|---|---|
TextureMapFragment | TextureMapFragment对象。 |
Method |
|---|
public void onActivityCreated(Bundle savedInstanceState) 继承自MapFragment的生命周期方法。 |
Parameters
Name | Description |
|---|---|
savedInstanceState | 保存TextureMapFragment状态。 |
Method |
|---|
public void onAttach(Activity activity) 继承自MapFragment的生命周期方法。 |
Parameters
Name | Description |
|---|---|
activity | TextureMapFragment绑定的Activity对象。 |
Method |
|---|
public void onCreate(Bundle savedInstanceState) 继承自MapFragment的生命周期方法。 |
Parameters
Name | Description |
|---|---|
savedInstanceState | 保存TextureMapFragment状态。 |
Method |
|---|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 继承自MapFragment的生命周期方法。 |
Parameters
Name | Description |
|---|---|
inflater | LayoutInflater对象,用来寻找布局中的控件。 |
container | 布局容器。 |
savedInstanceState | 保存TextureMapFragment状态。 |
Returns
Type | Description |
|---|---|
View | View对象。 |
Method |
|---|
public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState) 继承自MapFragment的生命周期方法,Fragment以XML方式静态加载时调用。 |
Parameters
Name | Description |
|---|---|
activity | TextureMapFragment绑定的Activity对象。 |
attrs | 创建TextureMapFragment时的属性。 |
savedInstanceState | 保存TextureMapFragment状态。 |
Method |
|---|
public void onSaveInstanceState(Bundle outState) 继承自MapFragment的生命周期方法,TextureMapFragment异常销毁时调用,用来存储TextureMapFragment在销毁之前的状态。 |
Parameters
Name | Description |
|---|---|
outState | 保存TextureMapFragment状态。 |
Method |
|---|
public void setArguments(Bundle args) 继承自MapFragment的生命周期方法,当需要向TextureMapFragment传递数据时调用。 |
Parameters
Name | Description |
|---|---|
args | 向TextureMapFragment传递的数据。 |