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.SupportMapFragment" 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 SupportMapFragment's onDestroyView()
method is called and the GoogleMapOptions.useViewLifecycleInFragment(boolean)
option is set. When this happens the SupportMapFragment is no longer valid until the view is recreated again later when the SupportMapFragment'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.
To use this class, you must include the Android support library in your build path.
Developer GuideFor more information, read the Google Maps SDK for Android developer guide.
Inherited Field Summary From class androidx.fragment.app.Fragment Public Constructor Summary Public Method Summary Inherited Method Summary From class androidx.fragment.app.Fragment void final boolean final FragmentActivitygetActivity()
booleangetAllowEnterTransitionOverlap()
booleangetAllowReturnTransitionOverlap()
final BundlegetArguments()
final FragmentManagergetChildFragmentManager()
ContextgetContext()
CreationExtrasgetDefaultViewModelCreationExtras()
ViewModelProvider.FactorygetDefaultViewModelProviderFactory()
ObjectgetEnterTransition()
ObjectgetExitTransition()
final FragmentManagergetFragmentManager()
final ObjectgetHost()
final intgetId()
LayoutInflater getLayoutInflater(
Bundlearg0)
final LayoutInflatergetLayoutInflater()
LifecyclegetLifecycle()
LoaderManagergetLoaderManager()
final FragmentgetParentFragment()
final FragmentManagergetParentFragmentManager()
ObjectgetReenterTransition()
final ResourcesgetResources()
final booleangetRetainInstance()
ObjectgetReturnTransition()
final SavedStateRegistrygetSavedStateRegistry()
ObjectgetSharedElementEnterTransition()
ObjectgetSharedElementReturnTransition()
final String final StringgetString(int arg0)
final StringgetTag()
final FragmentgetTargetFragment()
final intgetTargetRequestCode()
final CharSequencegetText(int arg0)
booleangetUserVisibleHint()
ViewgetView()
LifecycleOwnergetViewLifecycleOwner()
LiveData<LifecycleOwner>getViewLifecycleOwnerLiveData()
ViewModelStoregetViewModelStore()
final booleanhasOptionsMenu()
final inthashCode()
static Fragment static Fragment final booleanisAdded()
final booleanisDetached()
final booleanisHidden()
final booleanisInLayout()
final booleanisMenuVisible()
final booleanisRemoving()
final booleanisResumed()
final booleanisStateSaved()
final booleanisVisible()
void onActivityCreated(
Bundlearg0)
void onActivityResult(int arg0, int arg1,
Intentarg2)
void void void void boolean void AnimationonCreateAnimation(int arg0, boolean arg1, int arg2)
AnimatoronCreateAnimator(int arg0, boolean arg1, int arg2)
void void View voidonDestroy()
voidonDestroyOptionsMenu()
voidonDestroyView()
voidonDetach()
LayoutInflater onGetLayoutInflater(
Bundlearg0)
voidonHiddenChanged(boolean arg0)
void void voidonLowMemory()
voidonMultiWindowModeChanged(boolean arg0)
boolean void onOptionsMenuClosed(
Menuarg0)
voidonPause()
voidonPictureInPictureModeChanged(boolean arg0)
void onPrepareOptionsMenu(
Menuarg0)
voidonPrimaryNavigationFragmentChanged(boolean arg0)
void onRequestPermissionsResult(int arg0,
String[]arg1, int[] arg2)
voidonResume()
void onSaveInstanceState(
Bundlearg0)
voidonStart()
voidonStop()
void void onViewStateRestored(
Bundlearg0)
voidpostponeEnterTransition()
final void postponeEnterTransition(long arg0,
TimeUnitarg1)
final <I, O> ActivityResultLauncher<I>registerForActivityResult(ActivityResultContract<I, O> arg0, ActivityResultCallback<O> arg1)
final <I, O> ActivityResultLauncher<I>registerForActivityResult(ActivityResultContract<I, O> arg0, ActivityResultRegistry arg1, ActivityResultCallback<O> arg2)
void registerForContextMenu(
Viewarg0)
final void requestPermissions(
String[]arg0, int arg1)
final FragmentActivityrequireActivity()
final BundlerequireArguments()
final ContextrequireContext()
final FragmentManagerrequireFragmentManager()
final ObjectrequireHost()
final FragmentrequireParentFragment()
final ViewrequireView()
voidsetAllowEnterTransitionOverlap(boolean arg0)
voidsetAllowReturnTransitionOverlap(boolean arg0)
void voidsetEnterSharedElementCallback(SharedElementCallback arg0)
void setEnterTransition(
Objectarg0)
voidsetExitSharedElementCallback(SharedElementCallback arg0)
void setExitTransition(
Objectarg0)
voidsetHasOptionsMenu(boolean arg0)
void voidsetMenuVisibility(boolean arg0)
void setReenterTransition(
Objectarg0)
voidsetRetainInstance(boolean arg0)
void setReturnTransition(
Objectarg0)
void setSharedElementEnterTransition(
Objectarg0)
void setSharedElementReturnTransition(
Objectarg0)
void setTargetFragment(
Fragmentarg0, int arg1)
voidsetUserVisibleHint(boolean arg0)
boolean shouldShowRequestPermissionRationale(
Stringarg0)
void void void startActivityForResult(
Intentarg0, int arg1)
void startActivityForResult(
Intentarg0, int arg1,
Bundlearg2)
void voidstartPostponedEnterTransition()
StringtoString()
void unregisterForContextMenu(
Viewarg0)
From class java.lang.Object Objectclone()
boolean voidfinalize()
final Class<?>getClass()
inthashCode()
final voidnotify()
final voidnotifyAll()
StringtoString()
final voidwait(long arg0, int arg1)
final voidwait(long arg0)
final voidwait()
From interface android.content.ComponentCallbacks abstract void abstract voidonLowMemory()
From interface android.view.View.OnCreateContextMenuListener From interface androidx.lifecycle.LifecycleOwner abstract LifecyclegetLifecycle()
From interface androidx.lifecycle.ViewModelStoreOwner abstract ViewModelStoregetViewModelStore()
From interface androidx.lifecycle.HasDefaultViewModelProviderFactory CreationExtrasgetDefaultViewModelCreationExtras()
abstract ViewModelProvider.FactorygetDefaultViewModelProviderFactory()
From interface androidx.savedstate.SavedStateRegistryOwner abstract SavedStateRegistrygetSavedStateRegistry()
From interface androidx.activity.result.ActivityResultCaller abstract <I, O> ActivityResultLauncher<I>registerForActivityResult(ActivityResultContract<I, O> arg0, ActivityResultCallback<O> arg1)
abstract <I, O> ActivityResultLauncher<I>registerForActivityResult(ActivityResultContract<I, O> arg0, ActivityResultRegistry arg1, ActivityResultCallback<O> arg2)
Public Constructors public SupportMapFragment ()Creates a map fragment. This constructor is public only for use by an inflater. Use newInstance()
to create a SupportMapFragment programmatically.
Sets a callback object which will be triggered when the GoogleMap
instance is ready to be used.
Note that:
GoogleMap
object provided by the callback is non-null.null
. public static SupportMapFragment newInstance (GoogleMapOptions options)
Creates a map fragment with the given options.
Parameters options configuration GoogleMapOptions for aGoogleMap
, or null
to use the default options. public static SupportMapFragment 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.
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