简体   繁体   中英

How to handle the click event on current location icon on google maps in android

I am getting an icon shown in the figure on the google Maps. Now i have the confusion how to show the current location on the maps with marker whenever a user clicks on the current Location icon the google maps. After placing this code i got the icon on the google maps

Map.setMyLocationEnabled(true);

在此处输入图片说明

On the top-right google map is showing the current location icon, Now my confusion is how to handle this event to show my current location on the google maps.

use setOnMyLocationButtonClickListener() and override

@Override
public boolean onMyLocationButtonClick(){
   return false;
}

returning false does the default behavior

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM