public class MapFragment
extends Fragment
MapView
的Fragment, 由于 API Level要求在 12 以上的应用中。
如果你的应用要求在 API Level 12以下,用 SupportMapFragment
代替。
关于Fragment,参见 Android Fragment
Constructor and Description |
---|
MapFragment() |
Modifier and Type | Method and Description |
---|---|
TencentMap |
getMap()
获取当前Fragment的
MapView 关联的 TencentMap 对象 |
protected void |
initMap(Context context) |
static MapFragment |
newInstance(Context context)
创建一个新的MapFragment
|
void |
onAttach(Activity activity) |
void |
onCreate(Bundle bundle) |
protected MapView |
onCreateMapView(Context context,
TencentMapOptions options) |
View |
onCreateView(LayoutInflater layoutinflater,
ViewGroup viewgroup,
Bundle bundle) |
void |
onDestroy() |
void |
onDestroyView() |
void |
onInflate(Activity activity,
AttributeSet attributeset,
Bundle bundle) |
void |
onLowMemory() |
void |
onPause() |
void |
onResume() |
void |
onSaveInstanceState(Bundle bundle) |
void |
onStart() |
void |
onStop() |
void |
setArguments(Bundle bundle) |
void |
setOnTop(boolean isOnTop) |
protected MapView mapV
public static MapFragment newInstance(Context context)
context
- 要创建的Context, 参见 Android Contextprotected void initMap(Context context)
public TencentMap getMap()
MapView
关联的 TencentMap
对象public void onAttach(Activity activity)
public void onInflate(Activity activity, AttributeSet attributeset, Bundle bundle)
public void onCreate(Bundle bundle)
public View onCreateView(LayoutInflater layoutinflater, ViewGroup viewgroup, Bundle bundle)
protected MapView onCreateMapView(Context context, TencentMapOptions options)
public void onResume()
public void onPause()
public void onDestroyView()
public void onDestroy()
public void onStart()
public void onStop()
public void onLowMemory()
public void onSaveInstanceState(Bundle bundle)
public void setArguments(Bundle bundle)
public void setOnTop(boolean isOnTop)