selam arkadaslar yine aynı olay patlamıyor catch e dusmuyor ama değeri yazmıyor harita kullanmadığım için olabilirmi
public void updateWithNewLocation(Location location) {
locationListener = new android.location.LocationListener() {
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
lat = location.getLatitude();
lng = location.getLongitude();
textView1.setText(""+lat);
textView3.setText(""+lng);
Log.e("lat : ", "" + lat);
Log.e("lng : ", "" + lng);
String addressString = null;
Geocoder geoCoder = new Geocoder(getApplicationContext(), Locale.getDefault());
try {
List<Address> addresses = geoCoder.getFromLocation(lat,lng, 1);
if (addresses.size() == 1) {
addressString = "";
Address address = addresses.get(0);
for (int i = 0; i < address.getMaxAddressLineIndex(); i++) {
addressString += address.getAddressLine(i);
textAdress.setText(addressString );
Log.e("ADRESSSS", addressString );
}
}
} catch (IOException e) {
Log.e("ADRESSSS", e.getMessage() );
}
}
@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
};