A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/android/reference/com/google/android/gms/maps/MapFragment below:

MapFragment | Google Play services

A Map component in an app. This fragment is the simplest way to place a map in an application. It's a wrapper around a view of a map to automatically handle the necessary life cycle needs. Being a fragment, this component can be added to an activity's layout file simply with the XML below.

 <fragment
    class="com.google.android.gms.maps.MapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

A

GoogleMap

must be acquired using

getMapAsync(OnMapReadyCallback)

. This class automatically initializes the maps system and the view.

A view can be removed when the MapFragment's onDestroyView() method is called and the GoogleMapOptions.useViewLifecycleInFragment(boolean) option is set. When this happens the MapFragment is no longer valid until the view is recreated again later when the MapFragment's onCreateView(LayoutInflater, ViewGroup, Bundle) method is called.

Any objects obtained from the GoogleMap are associated with the view. It's important to not hold on to objects (e.g. Marker) beyond the view's life. Otherwise it will cause a memory leak as the view cannot be released.

Use this class only if you are targeting API 12 and above. Otherwise, use SupportMapFragment by adding the Android support library to your build path.

Developer Guide

For more information, read the Google Maps SDK for Android developer guide.

Inherited Constant Summary From interface android.content.ComponentCallbacks2 int TRIM_MEMORY_BACKGROUND int TRIM_MEMORY_COMPLETE int TRIM_MEMORY_MODERATE int TRIM_MEMORY_RUNNING_CRITICAL int TRIM_MEMORY_RUNNING_LOW int TRIM_MEMORY_RUNNING_MODERATE int TRIM_MEMORY_UI_HIDDEN Public Constructor Summary Public Method Summary Inherited Method Summary From class android.app.Fragment void final boolean final Activity

getActivity()

boolean

getAllowEnterTransitionOverlap()

boolean

getAllowReturnTransitionOverlap()

final Bundle

getArguments()

final FragmentManager

getChildFragmentManager()

Context

getContext()

Transition

getEnterTransition()

Transition

getExitTransition()

final FragmentManager

getFragmentManager()

final Object

getHost()

final int

getId()

final LayoutInflater

getLayoutInflater()

LoaderManager

getLoaderManager()

final Fragment

getParentFragment()

Transition

getReenterTransition()

final Resources

getResources()

final boolean

getRetainInstance()

Transition

getReturnTransition()

Transition

getSharedElementEnterTransition()

Transition

getSharedElementReturnTransition()

final String final String

getString(int arg0)

final String

getTag()

final Fragment

getTargetFragment()

final int

getTargetRequestCode()

final CharSequence

getText(int arg0)

boolean

getUserVisibleHint()

View

getView()

final int

hashCode()

static Fragment static Fragment final boolean

isAdded()

final boolean

isDetached()

final boolean

isHidden()

final boolean

isInLayout()

final boolean

isRemoving()

final boolean

isResumed()

final boolean

isStateSaved()

final boolean

isVisible()

void onActivityCreated

(

Bundle

arg0)

void onActivityResult

(int arg0, int arg1,

Intent

arg2)

void void void void boolean void Animator

onCreateAnimator(int arg0, boolean arg1, int arg2)

void void View void

onDestroy()

void

onDestroyOptionsMenu()

void

onDestroyView()

void

onDetach()

LayoutInflater onGetLayoutInflater

(

Bundle

arg0)

void

onHiddenChanged(boolean arg0)

void void void void

onLowMemory()

void

onMultiWindowModeChanged(boolean arg0)

void boolean void onOptionsMenuClosed

(

Menu

arg0)

void

onPause()

void void

onPictureInPictureModeChanged(boolean arg0)

void onPrepareOptionsMenu

(

Menu

arg0)

void onRequestPermissionsResult

(int arg0,

String[]

arg1, int[] arg2)

void

onResume()

void onSaveInstanceState

(

Bundle

arg0)

void

onStart()

void

onStop()

void

onTrimMemory(int arg0)

void void onViewStateRestored

(

Bundle

arg0)

void

postponeEnterTransition()

void registerForContextMenu

(

View

arg0)

final void requestPermissions

(

String[]

arg0, int arg1)

void

setAllowEnterTransitionOverlap(boolean arg0)

void

setAllowReturnTransitionOverlap(boolean arg0)

void void void void void void

setHasOptionsMenu(boolean arg0)

void void

setMenuVisibility(boolean arg0)

void void

setRetainInstance(boolean arg0)

void void setSharedElementEnterTransition

(

Transition

arg0)

void setSharedElementReturnTransition

(

Transition

arg0)

void setTargetFragment

(

Fragment

arg0, int arg1)

void

setUserVisibleHint(boolean arg0)

boolean shouldShowRequestPermissionRationale

(

String

arg0)

void void void startActivityForResult

(

Intent

arg0, int arg1)

void startActivityForResult

(

Intent

arg0, int arg1,

Bundle

arg2)

void void

startPostponedEnterTransition()

String

toString()

void unregisterForContextMenu

(

View

arg0)

From class java.lang.Object Object

clone()

boolean void

finalize()

final Class<?>

getClass()

int

hashCode()

final void

notify()

final void

notifyAll()

String

toString()

final void

wait(long arg0, int arg1)

final void

wait(long arg0)

final void

wait()

From interface android.content.ComponentCallbacks2 abstract void

onTrimMemory(int arg0)

From interface android.view.View.OnCreateContextMenuListener From interface android.content.ComponentCallbacks abstract void abstract void

onLowMemory()

Public Constructors public MapFragment ()

Creates a map fragment. This constructor is public only for use by an inflater. Use newInstance() to create a MapFragment programmatically.

Public Methods public void getMapAsync (OnMapReadyCallback callback)

Sets a callback object which will be triggered when the GoogleMap instance is ready to be used.

Note that:

Parameters callback The callback object that will be triggered when the map is ready to be used. Must not be null. public static MapFragment newInstance (GoogleMapOptions options)

Creates a map fragment with the given options.

Parameters options configuration GoogleMapOptions for a GoogleMap, or null to use the default options. public static MapFragment newInstance ()

Creates a map fragment, using default options.

public void onActivityCreated (Bundle savedInstanceState) public void onAttach (Activity activity) public void onCreate (Bundle savedInstanceState) public void onDestroyView () public final void onEnterAmbient (Bundle ambientDetails)

You must call this method from the parent WearableActivity's corresponding method.

public final void onExitAmbient ()

You must call this method from the parent WearableActivity's corresponding method.

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

Parse attributes during inflation from a view hierarchy into the arguments we handle.

public void onLowMemory () public void onSaveInstanceState (Bundle outState)

Provides a Bundle to store the state of the Fragment before it gets destroyed. It can later be retrieved when onCreate(Bundle) is called again.

public void setArguments (Bundle args)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4