Tuesday, September 18, 2012

Android 2.2 SDK with strings.xml having multiple %s


When building the SearchableDictionary examples using 2.2 SDK, the strings.xml contains the following which fails the compilation:

<plurals name="search_results"> 
  <item quantity="one">%d result for \"%s\": </item>
  <item quantity="other">%d results for \"%s\": </item>
</plurals>

We need to change them to the following in order make it compiled:


<plurals name="search_results"> 
  <item quantity="one">%1$d result for \"%2$s\": </item>
  <item quantity="other">%1$d results for \"%2$s\": </item>
</plurals>


Reference:

No comments:

Post a Comment

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...