Skip to content

Instantly share code, notes, and snippets.

@notdrone
Created December 30, 2015 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notdrone/a4e05af35e24bdbcbb60 to your computer and use it in GitHub Desktop.
Save notdrone/a4e05af35e24bdbcbb60 to your computer and use it in GitHub Desktop.
Plurals
<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="see_new_update">
<item quantity="one">1 new update</item>
<item quantity="other">%d new updates</item>
</plurals>
</resources>
String quantityString = context.getResources().getQuantityString(R.plurals.see_new_update,
StringUtil.str2Int(feed.getContent()),StringUtil.str2Int(feed.getContent()));
holder.newUpdateTextView.setText(quantityString);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment