【发布时间】:2014-10-11 06:03:00
【问题描述】:
我已经在我的应用中实现了 Google 地图。当我点击当前位置按钮时,如果 Gps 未启用,我想显示警报框。
我尝试了这种方式,我得到了那个按钮的视图。
SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
View plusMinusButton = fm.getView().findViewById(1);
View locationButton = fm.getView().findViewById(2);
使用 locationButton 我尝试使用 setOnclickListener 但没有帮助。
当我点击这张图片 时我的要求很简单,如果 gps 未启用,那么我必须显示警告框说 gps 未启用。
【问题讨论】:
标签: android google-maps gps google-maps-android-api-2