title: How to use Android quantity strings (plurals)
body: <p>I am trying to use the <a href="https://developer.android.com/reference/android/content/res/Resources.html#getQuantityString(int,%20int,%20java.lang.Object...)" rel="noreferrer">getQuantityString</a> method in Resources to retrieve <em>quantity strings</em> (plurals) based on Android Developer guidelines <a href="https://developer.android.com/guide/topics/resources/string-resource.html#Plurals" rel="noreferrer">Quantity string (plurals)</a></p>
  <p>The error I am getting is</p>
  <blockquote>
  <p>Error:(604) Multiple substitutions specified in non-positional format; did you mean to add the formatted=&quot;false&quot; attribute? <br />
  Error:(604) Found tag  where  is expected</p>
  </blockquote>
  <p>when I set up plurals as below</p>
  <pre><code>&lt;plurals name=&quot;productCount&quot;&gt;
      &lt;item quantity=&quot;one&quot; formatted=&quot;true&quot;&gt;%1$d of %2$d product&lt;/item&gt;
      &lt;item quantity=&quot;other&quot; formatted=&quot;true&quot;&gt;%1$d of %2$d products&lt;/item&gt;
  &lt;/plurals&gt;
  </code></pre>
  <p>And trying to read it as below
  productIndexCountText.setText(getResources().getQuantityString(R.plurals.productCount, position, size));</p>
  <p>One workaround is to break the string up to use plural only for the last part of the string and concatenate the two parts. But I am trying to avoid doing that if possible.</p>