问题
Hi i wants to hide/show map icon when my activity/page in background/foreground. i did not know how to do this because new in android so please reply as soon as possible.
回答1:
As you already call this mMap.setMyLocationEnabled(true)
in onCreate
or in setupMap
, you need to disable it in onPause
@Override
public void onPause() {
super.onPause();
if (mMap != null) {
mMap.setMyLocationEnabled(false);
}
}
来源:https://stackoverflow.com/questions/32316040/show-hide-google-map-icon-when-app-in-background