【发布时间】:2015-05-18 12:12:51
【问题描述】:
Google 地图显示 5.0.2 索尼 z2 平板电脑型号的蓝屏,其中显示设备中的当前位置
在平板设备中启用定位服务
这是使用的播放服务版本
<integer name="google_play_services_version">7095000</integer>
这是在地图上显示当前位置的源代码
@Override
public void onLocationChanged(Location location) {
// TextView locationTv = (TextView) findViewById(R.id.latlongLocation);
try {
latitude = location.getLatitude();
longitude = location.getLongitude();
LatLng latLng = new LatLng(latitude, longitude);
String address = getLocationName(latitude,longitude);
if(mCurrentLocationMarker != null){
mCurrentLocationMarker.remove();
}
mCurrentLocationMarker = googleMap.addMarker(new MarkerOptions().position(latLng).title(address));
googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
googleMap.animateCamera(CameraUpdateFactory.zoomTo(15));
Log.i(TAG, "Latitude:" + latitude + "," + "Longitude:" + longitude);
} catch (Exception e) {
e.printStackTrace();
}
}
平板电脑地图蓝屏会是什么问题?
【问题讨论】:
-
请从您的代码实现中截屏和更多内容
-
AndroidManifest.xml有问题。请参考答案stackoverflow.com/a/29619395/1994950 -
一切都在清单中,当我向下拖动蓝屏时,我可以看到带有当前位置和我的标记的地图。但默认情况下,当我们 luach 显示蓝屏时
标签: android google-maps google-play-services android-maps