Challenge: Plural String Resources

The subtitle is not grammatically correct when there is a single crime. 1 crimes just does not show the right amount of attention to detail for your taste. For this challenge, correct this subtitle text.

You could have two different strings and determine which one to use in code, but this will quickly fall apart when you localize your app for different languages. A better option is to use plural string resources (sometimes also called quantity strings).

First, define a plural string in your strings.xml file.

<​p​l​u​r​a​l​s​ ​n​a​m​e​=​"​s​u​b​t​i​t​l​e​_​p​l​u​r​a​l​"​>​ ​ ​ ​ ​<​i​t​e​m​ ​q​u​a​n​t​i​t​y​=​"​o​n​e​"​>​%​1​$​s​ ​c​r​i​m​e​<​/​i​t​e​m​>​ ​ ​ ​ ​<​i​t​e​m​ ​q​u​a​n​t​i​t​y​=​"​o​t​h​e​r​"​>​%​1​$​s​ ...

Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.