Хочу присвоить переменной а ширину и долготу a = location.getLatitude();
но выдает ошибку -Required type:
String
Provided:
double
public double getLatitude()
Get the latitude, in degrees.
All locations generated by the LocationManager will have a valid latitude.
вот код
private String formatLocation(Location location) {
if (location == null)
return "";
String a, b, answerHTTP;
a = location.getLatitude();
b = location.getLongitude();
String server = "http://demo.harrix.org/demo0011";
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(server + "?a=" + location.getLatitude() + "&b=" + location.getLongitude());
try {
HttpResponse response = httpclient.execute(httpget);
if (response.getStatusLine().getStatusCode() == 200) {
HttpEntity entity = response.getEntity();
answerHTTP = EntityUtils.toString(entity);
}
}
catch (ClientProtocolException e) {
}
catch (IOException e) {
}