Ich folgte diesen Ort Koordinaten und Adresse zu erhalten
Also hier seine immer Updates Lage Koordinaten Breite und Länge für alle 10 Sekunden
Ich versuche Ort Adresse mit ihnen auszukommen
Hier Get - Adresse Ich bin mit Const Klasse
public class Const {
public static String getCompleteAddressString(Context m_context, double LATITUDE, double LONGITUDE) {
String strAdd = ;
Geocoder geocoder = new Geocoder(m_context, Locale.getDefault());
try {
List<Address> addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 1);
if (addresses != null) {
Address returnedAddress = addresses.get(0);
StringBuilder strReturnedAddress = new StringBuilder();
for (int i = 0; i < returnedAddress.getMaxAddressLineIndex(); i++) {
strReturnedAddress.append(returnedAddress.getAddressLine(i)).append(\n);
}
strAdd = strReturnedAddress.toString();
Log.v(My Current location add, + strAdd.toString());
}
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(m_context, Sorry, Your location cannot be retrieved ! + e.getMessage(), Toast.LENGTH_SHORT).show();
}
return strAdd;
}
}
Und jetzt Hauptaktivität Um Adresse Ich bin mit
private void updateUI() {
mLatitudeTextView.setText(String.format(%s: %f, mLatitudeLabel,
mCurrentLocation.getLatitude()));
mLongitudeTextView.setText(String.format(%s: %f, mLongitudeLabel,
mCurrentLocation.getLongitude()));
mLastUpdateTimeTextView.setText(String.format(%s: %s, mLastUpdateTimeLabel,
mLastUpdateTime));
//For Address
mLocAddTextView.setText(String.format(%s: %s, mLocAddressLabel,
Const.getCompleteAddressString(this, mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude())));
}
Aber hier und Anzeigen im Display nichts kann mir einer vorschlagen, was ist falsch in diesem













