anand
anand

Reputation: 1771

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);

enter image description here

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.

Upvotes: 0

Views: 1759

Answers (1)

tyczj
tyczj

Reputation: 74066

use setOnMyLocationButtonClickListener() and override

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

returning false does the default behavior

Upvotes: 1

Related Questions