You can write a method:
Location createNewLocation(double longitude, double latitude) { Location location = new Location("dummyprovider"); location.setLongitude(longitude); location.setLatitude(latitude); return location; }
And then call it:
Location myLoc = createNewLocation(dLong, dLati);
Or you can use the line with Double.parse ():
Location myLoc = createNewLocation(Double.parse("s.Long"), Double.parse("s.Lati"));
Kuvalya Oct. 16 '16 at 21:01 2016-10-16 21:01
source share