【发布时间】:2014-01-31 02:01:45
【问题描述】:
我有以下字符串资源:
<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>
这在 Activity 中被使用:
String residentialUrl = task.getSearchUrl(_map.getProjection().getVisibleRegion().latLngBounds,getString(R.string.residential_search_url));
并且方法定义为:
public String getSearchUrl(LatLngBounds bounds, String baseUrl){
return String.format(baseUrl,
bounds.southwest.latitude,
bounds.northeast.latitude,
bounds.southwest.longitude,
bounds.northeast.longitude);
}
我不断得到:
java.util.UnknownFormatConversionException: Conversion = l''
我也尝试使用%s 代替%f,但没有任何区别。
【问题讨论】:
标签: java android android-resources