【发布时间】:2015-11-01 10:38:45
【问题描述】:
在我的 android 应用程序中,我计算 gps 位置并将 lat 日志值显示到 TextView 中,我使用这个 lat long 值在 SQLITE DB 上进行查询。 现在我试图在 TextView 中显示由 lat 和 log 计算的 Location 的名称。我尝试了 geocodeby 我有 soma 错误。 这是我计算纬度和经度值的代码:
ImageView bt_get_mygpspos = (ImageView)getView().findViewById(R.id.bt_get_mygpspos);
edittext_mygpspos = (EditText)getView().findViewById(R.id.edittext_mygpspos);
bt_get_mygpspos.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
GPSTracker mGPS = new GPSTracker(getActivity());
if(mGPS.canGetLocation() ){
query.curPos = new LatLng(mGPS.getLatitude(),mGPS.getLongitude());
edittext_mygpspos.setText("lat:"+query.curPos.latitude+" lon:"+query.curPos.longitude);
Log.e("test", "lat:"+query.curPos.latitude+" lon:"+query.curPos.longitude);
}else{
mGPS.showSettingsAlert();
}
}
});
我如何转换位置名称中的 mGPS.Latitude 和 Longitude 以显示到 TextView 中?
比
【问题讨论】: