Skip to content

Instantly share code, notes, and snippets.

@Tarelochkin
Created October 2, 2017 07:00
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 Tarelochkin/3a3bd68c9e87330e44469a590740c074 to your computer and use it in GitHub Desktop.
Save Tarelochkin/3a3bd68c9e87330e44469a590740c074 to your computer and use it in GitHub Desktop.
<plurals name="charge_notification_count">
<item quantity="zero">Hydrate while charging reminder sent %d times</item>
<item quantity="one">Hydrate while charging reminder sent %d time</item>
<item quantity="other">Hydrate while charging reminder sent %d times</item>
</plurals>
int count = PreferenceUtilities.getChargingReminderCount(this);
//the first count parameter selects the appropriate plural string and the second count parameter is inserted into the %d placeholder.
String formattedChargingReminders = getResources().getQuantityString(R.plurals.charge_notification_count, count, count);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment