学习中遇到这个问题!
as警告
mplicitly using the default locale is a common source of bugs: Use String.format(Locale, ...)
在
String.format(Locale.CHINA,"……
加上如下代码即可
Locale.CHINA,
@Override
public void onLocationChanged(Location location) {
String str = "定位提供者:"+location.getProvider();
str += String.format(Locale.CHINA,"\n纬度:%.5f\n经度:%.5f\n高度:%.2f米",
location.getLatitude(),
location.getLongitude(),
location.getAltitude());
loc.setText(str);
}