在后台应用中显示/隐藏谷歌地图图标 [英] Show/hide google Map icon when app in background
本文介绍了在后台应用中显示/隐藏谷歌地图图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,当我的活动/网页位于后台/前台时,我想要隐藏/显示地图图标。
我不知道如何做到这一点,因为在android中新增,所以请尽快回复。
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.
推荐答案
您已经在 onCreate
或 setupMap中称此
,您需要在 mMap.setMyLocationEnabled(true)
> setupMap onPause
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);
}
}
这篇关于在后台应用中显示/隐藏谷歌地图图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文