[android]代码库
/**
* 定位成功后回调函数
*/
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null && amapLocation != null) {
if (amapLocation != null
&& amapLocation.getAMapException().getErrorCode() == 0) {
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
} else {
}
if(!amapLocation.getCity().equals("")){
Intent intent = new Intent();
intent.setClass(AishangSanfuLocation.this, CityList.class);
intent.putExtra("city", amapLocation.getCity());
startActivity(intent);
finish();
}else{
Toast.makeText(AishangSanfuLocation.this, "定位失败", Toast.LENGTH_SHORT).show();
}
}
}
[源代码打包下载]
中级程序员
by: 风清云 发表于:2015-01-21 21:56:34 顶(0) | 踩(0) 回复
学习了
回复评论