Q:

String to degree coordinate

I need to convert coordinates from Location into a String to show in a EditText. Then, I need to convert back these strings into coordinates again to set it into location object.
This is what I do:
String latitude = mLocation.convert(mLocation.getLatitude(), mLocation.FORMAT_DEGREES);
String longitude = mLocation.convert(mLocation.getLongitude(), mLocation.FORMAT_DEGREES);

latitudeEditText.setText(latitude);
longitudeEditText.setText(longitude);

This way, I convert something like 43.56432 into 43,56432.
Now, I need to set this value back from the EditText into Location. This is what I do:
String latitude = latitudeEditText.getText().toString();
String longitude = longitudeEditText.getText().toString();

mLocation.setLatitude(mLocation.convert(latitude));
mLocation.setLongitude(mLocation.convert(longitude));

But when mLocation.convert(latitude) is throwing a IllegalArgumentException.
In the documentation sais:
public static double convert (String coordinate)

Added in API level 1
Converts a String in one of the formats described by FORMAT_DEGREES, 
    FORMAT_MINUTES, or FORMAT_SECONDS into a double.

Throws
NullPointerException    if coordinate is null
IllegalArgumentException    if the coordinate is not in one of the valid formats.

So, this is telling me that the String isn't in DEGREE format, but this can't be, because I use booth ways the convert() method to do it right.

A:

Just tried a quick test and everything works as expected:
Location mLocation = new Location("");
mLocation.setLatitude(43.56432);

String latitude = Location.convert(mLocation.getLatitude(), Location.FORMAT_DEGREES);

Log.d(TAG, "Latitude: " + latitude);

double latitudeDouble = Location.convert(latitude);

Log.d(TAG, "Latitude double: " + latitudeDouble);

Output:
01-30 16:12:53.628: D/LocationActivity(29240): Latitude: 43.56432
01-30 16:12:53.628: D/LocationActivity(29240): Latitude double: 43.56432

Do you have any TextWatchers or anything other logic on your EditText that replace the period with a comma? 
Also, make sure you access static fields statically.

