Show/hide google Map icon when app in background

本秂侑毒 提交于 2020-01-06 17:55:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!