Richiamato quando viene fatto clic sul pulsante La mia località.
Metodi pubblici
pubblico
astratto
booleano
onMyLocationButtonClick()
Richiamato quando viene fatto clic sul pulsante La mia località.
Questo viene chiamato nel thread dell'interfaccia utente di Android.
Utilizza com.google.android.gms.location.FusedLocationProviderApi se devi ottenere la posizione attuale dell'utente.
Ritorni
true se il listener ha utilizzato l'evento (ovvero non deve verificarsi il comportamento predefinito); false in caso contrario (deve verificarsi il comportamento predefinito). Il
comportamento predefinito prevede lo spostamento della videocamera in modo che sia centrata sulla posizione dell'utente.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-13 UTC."],[[["`GoogleMap.OnMyLocationButtonClickListener` is an interface used to handle clicks on the \"My Location\" button within a Google Map."],["The primary method, `onMyLocationButtonClick()`, is called when the button is clicked and allows custom actions to be performed before or instead of the default camera movement."],["Returning `true` from `onMyLocationButtonClick()` prevents the default behavior (centering the camera on the user's location), while returning `false` allows it."]]],["The `GoogleMap.OnMyLocationButtonClickListener` interface triggers the `onMyLocationButtonClick()` method when the \"My Location\" button is pressed. This method, executed on the UI thread, allows developers to handle the event. Returning `true` prevents the default camera movement to the user's location, while `false` allows it. For retrieving the user's location, the `FusedLocationProviderApi` is recommended.\n"]]