들으 라 내가 project 내 프로젝트 나는 현재의 위도 - long.But을 보여, 내 현재 위치를 표시하고에서은 표시 할 수 없습니다
내가 표시 할 을 할 수 아니에요입니다 안드로이드에 내 현재 위치.
Thnx.
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
Log.d(TAG, "onLocationChanged with location " + location.toString());
// Displays lat, long, altitude and bearing
String text = String.format("Lat:\t %f\nLong:\t %f\nAlt:\t %f\nBearing:\t %f", location.getLatitude(), location.getLongitude(), location.getAltitude(), location.getBearing());
this.locationText.setText(text);
try {
// This gets a list of addresses
List<Address> addresses = geocoder.getFromLocation(location.getLatitude(),
location.getLongitude(), 10);
for (Address address : addresses) {
this.locationText.append("\n" + "kaushik");
}
// Convert latitude and longitude into int that the GeoPoint constructor can understand
int latitude = (int)(location.getLatitude() * 1000000);
int longitude = (int)(location.getLongitude() * 1000000);
point = new GeoPoint(latitude,longitude);
mapController.animateTo(point);
mapController.setZoom(16);
MapOverlay mapOverLay=new MapOverlay();
mapOverLay.setPointToDraw(point);
List<Overlay> listOfOverlays=map.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverLay);
map.invalidate();
} catch (IOException e) {
Log.e("LocateMe", "Could not get Geocoder data", e);
}
}
붙여 넣기를 사용하여 코드를 수정하여 변경할 수 있습니다. –
@Agarwal 이미 프로젝트를 향상 시켰습니다. – kaushikSuman
당신의 죄봉을 붙여 넣을 수 있다면 더 좋을 것 같습니다. –