Issue
I have the following string resource:
<string formatted="false" name="residential_search_url">https://api.trademe.co.nz/v1/Search/Property/Residential.json?latitude_min=%f%26latitude_max=%f%26longitude_min=%f%26longitude_max=%f</string>
This is being used in an Activity by:
String residentialUrl = task.getSearchUrl(_map.getProjection().getVisibleRegion().latLngBounds,getString(R.string.residential_search_url));
And the method is defined as:
public String getSearchUrl(LatLngBounds bounds, String baseUrl){
return String.format(baseUrl,
bounds.southwest.latitude,
bounds.northeast.latitude,
bounds.southwest.longitude,
bounds.northeast.longitude);
}
I keep getting:
java.util.UnknownFormatConversionException: Conversion = l''
I have also tried using %s
in place of %f
and it made no difference.
Solution
My fix was to use &
to escape the ampersand, instead of %26
.
Answered By - codedog
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.